Beispiel #1
0
 /// <summary>
 /// Copy constructor.
 /// </summary>
 public CPPEnvironmentConfiguration(CPPEnvironmentConfiguration InCopyEnvironment)
 {
     Platform                         = InCopyEnvironment.Platform;
     Configuration                    = InCopyEnvironment.Configuration;
     Architecture                     = InCopyEnvironment.Architecture;
     OutputDirectory                  = InCopyEnvironment.OutputDirectory;
     PCHOutputDirectory               = InCopyEnvironment.PCHOutputDirectory;
     LocalShadowDirectory             = InCopyEnvironment.LocalShadowDirectory;
     PrecompiledHeaderIncludeFilename = InCopyEnvironment.PrecompiledHeaderIncludeFilename;
     PrecompiledHeaderAction          = InCopyEnvironment.PrecompiledHeaderAction;
     bUseRTTI                         = InCopyEnvironment.bUseRTTI;
     bUseAVX             = InCopyEnvironment.bUseAVX;
     bFasterWithoutUnity = InCopyEnvironment.bFasterWithoutUnity;
     MinSourceFilesForUnityBuildOverride    = InCopyEnvironment.MinSourceFilesForUnityBuildOverride;
     MinFilesUsingPrecompiledHeaderOverride = InCopyEnvironment.MinFilesUsingPrecompiledHeaderOverride;
     bBuildLocallyWithSNDBS       = InCopyEnvironment.bBuildLocallyWithSNDBS;
     bEnableExceptions            = InCopyEnvironment.bEnableExceptions;
     bEnableShadowVariableWarning = InCopyEnvironment.bEnableShadowVariableWarning;
     bOptimizeCode        = InCopyEnvironment.bOptimizeCode;
     bCreateDebugInfo     = InCopyEnvironment.bCreateDebugInfo;
     bIsBuildingLibrary   = InCopyEnvironment.bIsBuildingLibrary;
     bIsBuildingDLL       = InCopyEnvironment.bIsBuildingDLL;
     bUseStaticCRT        = InCopyEnvironment.bUseStaticCRT;
     bEnableOSX109Support = InCopyEnvironment.bEnableOSX109Support;
     CPPIncludeInfo.IncludePaths.UnionWith(InCopyEnvironment.CPPIncludeInfo.IncludePaths);
     CPPIncludeInfo.SystemIncludePaths.UnionWith(InCopyEnvironment.CPPIncludeInfo.SystemIncludePaths);
     ForceIncludeFiles.AddRange(InCopyEnvironment.ForceIncludeFiles);
     Definitions.AddRange(InCopyEnvironment.Definitions);
     AdditionalArguments = InCopyEnvironment.AdditionalArguments;
     AdditionalFrameworks.AddRange(InCopyEnvironment.AdditionalFrameworks);
 }
Beispiel #2
0
 /// <summary>
 /// Validate configuration for this platform
 /// NOTE: This function can/will modify BuildConfiguration!
 /// </summary>
 /// <param name="InPlatform">  The CPPTargetPlatform being built</param>
 /// <param name="InConfiguration"> The CPPTargetConfiguration being built</param>
 /// <param name="bInCreateDebugInfo">true if debug info is getting create, false if not</param>
 public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
 {
     UEBuildConfiguration.bCompileSimplygon    = false;
     UEBuildConfiguration.bCompileSimplygonSSF = false;
     // depends on arch, APEX cannot be as of November'16 compiled for AArch32/64
     UEBuildConfiguration.bCompileAPEX = GetActiveArchitecture().StartsWith("x86_64");
 }
 /// <summary>
 /// Copy constructor.
 /// </summary>
 public LinkEnvironmentConfiguration(LinkEnvironmentConfiguration InCopyEnvironment)
 {
     Platform              = InCopyEnvironment.Platform;
     Configuration         = InCopyEnvironment.Configuration;
     Architecture          = InCopyEnvironment.Architecture;
     OutputDirectory       = InCopyEnvironment.OutputDirectory;
     IntermediateDirectory = InCopyEnvironment.IntermediateDirectory;
     LocalShadowDirectory  = InCopyEnvironment.LocalShadowDirectory;
     OutputFilePaths       = InCopyEnvironment.OutputFilePaths.ToList();
     ProjectFile           = InCopyEnvironment.ProjectFile;
     LibraryPaths.AddRange(InCopyEnvironment.LibraryPaths);
     ExcludedLibraries.AddRange(InCopyEnvironment.ExcludedLibraries);
     AdditionalLibraries.AddRange(InCopyEnvironment.AdditionalLibraries);
     Frameworks.AddRange(InCopyEnvironment.Frameworks);
     AdditionalShadowFiles.AddRange(InCopyEnvironment.AdditionalShadowFiles);
     AdditionalFrameworks.AddRange(InCopyEnvironment.AdditionalFrameworks);
     WeakFrameworks.AddRange(InCopyEnvironment.WeakFrameworks);
     AdditionalBundleResources.AddRange(InCopyEnvironment.AdditionalBundleResources);
     DelayLoadDLLs.AddRange(InCopyEnvironment.DelayLoadDLLs);
     AdditionalArguments           = InCopyEnvironment.AdditionalArguments;
     bCreateDebugInfo              = InCopyEnvironment.bCreateDebugInfo;
     bIsBuildingLibrary            = InCopyEnvironment.bIsBuildingLibrary;
     bIsBuildingDLL                = InCopyEnvironment.bIsBuildingDLL;
     bIsBuildingConsoleApplication = InCopyEnvironment.bIsBuildingConsoleApplication;
     WindowsEntryPointOverride     = InCopyEnvironment.WindowsEntryPointOverride;
     bIsCrossReferenced            = InCopyEnvironment.bIsCrossReferenced;
     bHasExports = InCopyEnvironment.bHasExports;
     bIsBuildingDotNetAssembly = InCopyEnvironment.bIsBuildingDotNetAssembly;
 }
        static string GetSharedArguments_Global(CPPTargetConfiguration TargetConfiguration, string Architecture, bool bEnableShadowVariableWarning)
        {
            string Result = " ";

            if (Architecture == "-win32")
            {
                return(Result);
            }

            //          Result += " -funsigned-char";
            //          Result += " -fno-strict-aliasing";
            Result += " -fno-exceptions";
            //          Result += " -fno-short-enums";

            Result += " -Wno-unused-value";                               // appErrorf triggers this
            Result += " -Wno-switch";                                     // many unhandled cases
            Result += " -Wno-tautological-constant-out-of-range-compare"; // disables some warnings about comparisons from TCHAR being a char
            // this hides the "warning : comparison of unsigned expression < 0 is always false" type warnings due to constant comparisons, which are possible with template arguments
            Result += " -Wno-tautological-compare";

            // okay, in UE4, we'd fix the code for these, but in UE3, not worth it
            Result += " -Wno-logical-op-parentheses"; // appErrorf triggers this
            Result += " -Wno-array-bounds";           // some VectorLoads go past the end of the array, but it's okay in that case
            Result += " -Wno-invalid-offsetof";       // too many warnings kills windows clang.

            if (bEnableShadowVariableWarning)
            {
                Result += " -Wshadow" + (BuildConfiguration.bShadowVariableErrors? "" : " -Wno-error=shadow");
            }

            // JavsScript option overrides (see src/settings.js)

            // we have to specify the full amount of memory with Asm.JS (1.5 G)
            // I wonder if there's a per game way to change this.
            int TotalMemory = 256 * 1024 * 1024;

            Result += " -s TOTAL_MEMORY=" + TotalMemory.ToString();

            // no need for exceptions
            Result += " -s DISABLE_EXCEPTION_CATCHING=1";
            // enable checking for missing functions at link time as opposed to runtime
            Result += " -s WARN_ON_UNDEFINED_SYMBOLS=1";
            // we want full ES2
            Result += " -s FULL_ES2=1 ";
            // export console command handler. Export main func too because default exports ( e.g Main ) are overridden if we use custom exported functions.
            Result += " -s EXPORTED_FUNCTIONS=\"['_main', '_resize_game', '_on_fatal']\" ";

            // NOTE: This may slow down the compiler's startup time!
            {
                Result += " -s NO_EXIT_RUNTIME=1 --memory-init-file 1";
            }

            if (bEnableTracing)
            {
                Result += " --tracing";
            }

            return(Result);
        }
 public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
 {
     BuildConfiguration.bUsePCHFiles   = false;
     BuildConfiguration.bUseSharedPCHs = false;
     BuildConfiguration.bCheckExternalHeadersForModification = false;
     BuildConfiguration.bCheckSystemHeadersForModification   = false;
     BuildConfiguration.ProcessorCountMultiplier             = IOSToolChain.GetAdjustedProcessorCountMultiplier();
     BuildConfiguration.bDeployAfterCompile = true;
 }
 public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
 {
     // @todo clang: PCH files aren't quite working yet with "clang-cl" (no /Yc support, and "-x c++-header" cannot be specified)
     if (WindowsPlatform.bCompileWithClang)
     {
         BuildConfiguration.bUsePCHFiles   = false;
         BuildConfiguration.bUseSharedPCHs = false;
     }
 }
Beispiel #7
0
 /// <summary>
 /// Whether PDB files should be used
 /// </summary>
 /// <param name="InPlatform">  The CPPTargetPlatform being built</param>
 /// <param name="InConfiguration"> The CPPTargetConfiguration being built</param>
 /// <param name="bInCreateDebugInfo">true if debug info is getting create, false if not</param>
 /// <returns>bool true if PDB files should be used, false if not</returns>
 public override bool ShouldUsePDBFiles(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration, bool bCreateDebugInfo)
 {
     // Only supported on PC.
     if (bCreateDebugInfo && ShouldUseIncrementalLinking(Platform, Configuration))
     {
         return(true);
     }
     return(false);
 }
		static string GetSharedArguments_Global(CPPTargetConfiguration TargetConfiguration, string Architecture, bool bEnableShadowVariableWarning)
		{
            string Result = " ";

            if (Architecture == "-win32")
            {
                return Result;
            }

            // 			Result += " -funsigned-char";
            // 			Result += " -fno-strict-aliasing";
            Result += " -fno-exceptions";
            // 			Result += " -fno-short-enums";

            Result += " -Wno-unused-value"; // appErrorf triggers this
            Result += " -Wno-switch"; // many unhandled cases
            Result += " -Wno-tautological-constant-out-of-range-compare"; // disables some warnings about comparisons from TCHAR being a char
            // this hides the "warning : comparison of unsigned expression < 0 is always false" type warnings due to constant comparisons, which are possible with template arguments
            Result += " -Wno-tautological-compare";

            // okay, in UE4, we'd fix the code for these, but in UE3, not worth it
            Result += " -Wno-logical-op-parentheses"; // appErrorf triggers this
            Result += " -Wno-array-bounds"; // some VectorLoads go past the end of the array, but it's okay in that case
            Result += " -Wno-invalid-offsetof"; // too many warnings kills windows clang. 

			if (bEnableShadowVariableWarning)
			{
				Result += " -Wshadow" + (BuildConfiguration.bShadowVariableErrors? "" : " -Wno-error=shadow");
			}

            // JavsScript option overrides (see src/settings.js)

            // we have to specify the full amount of memory with Asm.JS (1.5 G)
            // I wonder if there's a per game way to change this. 
			int TotalMemory = 256 * 1024 * 1024;
            Result += " -s TOTAL_MEMORY=" + TotalMemory.ToString();

            // no need for exceptions
            Result += " -s DISABLE_EXCEPTION_CATCHING=1";
            // enable checking for missing functions at link time as opposed to runtime
            Result += " -s WARN_ON_UNDEFINED_SYMBOLS=1";
            // we want full ES2
            Result += " -s FULL_ES2=1 ";
            // export console command handler. Export main func too because default exports ( e.g Main ) are overridden if we use custom exported functions. 
            Result += " -s EXPORTED_FUNCTIONS=\"['_main', '_resize_game', '_on_fatal']\" ";

            // NOTE: This may slow down the compiler's startup time!
            { 
                Result += " -s NO_EXIT_RUNTIME=1 --memory-init-file 1";
            }

            if (bEnableTracing)
            {
            	Result += " --tracing";
            }
            return Result;
		}
        /// <summary>
        /// Validates the configuration. E.g. some options are mutually exclusive whereof some imply others. Also
        /// some functionality is not available on all platforms.
        /// @warning: the order of validation is important
        /// </summary>
        /// <param name="Configuration">Current configuration (e.g. development, debug, ...)</param>
        /// <param name="Platform">Current platform (e.g. Win32, PS3, ...)</param>
        /// <param name="bCreateDebugInfo">True if debug info should be created</param>
        public static void ValidateConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
        {
            var BuildPlatform = UEBuildPlatform.GetBuildPlatformForCPPTargetPlatform(Platform);

            // E&C support.
            if (bSupportEditAndContinue)
            {
                bUseIncrementalLinking = BuildPlatform.ShouldUseIncrementalLinking(Platform, Configuration);
            }

            // Incremental linking.
            if (bUseIncrementalLinking)
            {
                bUsePDBFiles = BuildPlatform.ShouldUsePDBFiles(Platform, Configuration, bCreateDebugInfo);
            }

            // Detailed stats
            if (bLogDetailedActionStats && bAllowXGE)
            {
                // Some build machines apparently have this turned on, so if you really want detailed stats, don't run with XGE
                bLogDetailedActionStats = false;
            }

            // PDB
            if (bUsePDBFiles)
            {
                // NOTE: Currently we allow XGE to run, even with PDBs, until we notice an issue with this
                bool bDisallowXGEWithPDBFiles = false;
                if (bDisallowXGEWithPDBFiles)
                {
                    // Force local execution as we have one PDB for all files using the same PCH. This currently doesn't
                    // scale well with XGE due to required networking bandwidth. Xoreax mentioned that this was going to
                    // be fixed in a future version of the software.
                    bAllowXGE = false;
                }
            }

            // Allow for the build platform to perform custom validation here...
            // NOTE: This CAN modify the static BuildConfiguration settings!!!!
            BuildPlatform.ValidateBuildConfiguration(Configuration, Platform, bCreateDebugInfo);

            if (!BuildPlatform.CanUseXGE())
            {
                bAllowXGE = false;
            }

            if (!BuildPlatform.CanUseDistcc())
            {
                bAllowDistcc = false;
            }

            if (!BuildPlatform.CanUseSNDBS())
            {
                bAllowSNDBS = false;
            }
        }
Beispiel #10
0
 public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
 {
     // @todo clang: PCH files aren't supported by "clang-cl" yet (no /Yc support, and "-x c++-header" cannot be specified)
     // @todo clang: PCH files with regular Clang on Windows have bugs with pack alignment and segfaults occasionally
     if (WindowsPlatform.bCompileWithClang)
     {
         BuildConfiguration.bUsePCHFiles   = false;
         BuildConfiguration.bUseSharedPCHs = false;
     }
 }
Beispiel #11
0
 public string GetAdditionalLinkerFlags(CPPTargetConfiguration InConfiguration)
 {
     if (InConfiguration != CPPTargetConfiguration.Shipping)
     {
         return(AdditionalLinkerFlags);
     }
     else
     {
         return(AdditionalShippingLinkerFlags);
     }
 }
Beispiel #12
0
		public string GetAdditionalLinkerFlags(CPPTargetConfiguration InConfiguration)
		{
			if (InConfiguration != CPPTargetConfiguration.Shipping)
			{
				return AdditionalLinkerFlags;
			}
			else
			{
				return AdditionalShippingLinkerFlags;
			}

		}
Beispiel #13
0
        /** Accesses the bin directory for the VC toolchain for the specified platform. */
        static string GetVCToolPath(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration, string ToolName)
        {
            // Initialize environment variables required for spawned tools.
            InitializeEnvironmentVariables(Platform);

            // Out variable that is going to contain fully qualified path to executable upon return.
            string VCToolPath = "";

            // is target 64-bit?
            bool bIsTarget64Bit = true;

            // We need to differentiate between 32 and 64 bit toolchain on Windows.
            {
                // rc.exe resides in the Windows SDK folder.
                if (ToolName.ToUpperInvariant() == "RC")
                {
                    // 64 bit -- we can use the 32 bit version to target 64 bit on 32 bit OS.
                    if (bIsTarget64Bit)
                    {
                        VCToolPath = Path.Combine(WindowsSDKDir, "bin/x64/rc.exe");
                    }
                    // 32 bit
                    else
                    {
                        VCToolPath = Path.Combine(WindowsSDKDir, "bin/x86/rc.exe");
                    }
                }
                // cl.exe and link.exe are found in the toolchain specific folders (32 vs. 64 bit). We do however use the 64 bit linker if available
                // even when targeting 32 bit as it's noticeably faster.
                else
                {
                    // Grab path to Visual Studio binaries from the system environment
                    string BaseVSToolPath = WindowsPlatform.GetVSComnToolsPath(WindowsCompiler.VisualStudio2012);
                    if (string.IsNullOrEmpty(BaseVSToolPath))
                    {
                        throw new BuildException("Visual Studio 2012 must be installed in order to build this target.");
                    }

                    if (Platform == CPPTargetPlatform.WinRT_ARM)
                    {
                        VCToolPath = Path.Combine(BaseVSToolPath, "../../VC/bin/x86_arm/" + ToolName + ".exe");
                    }
                    else
                    {
                        VCToolPath = Path.Combine(BaseVSToolPath, "../../VC/bin/amd64/" + ToolName + ".exe");
                    }
                }
            }

            return(VCToolPath);
        }
Beispiel #14
0
        public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
        {
            if (WindowsPlatform.bCompileWithClang)
            {
                // @todo clang: Shared PCHs don't work on clang yet because the PCH will have definitions assigned to different values
                // than the consuming translation unit.  Unlike the warning in MSVC, this is a compile in Clang error which cannot be suppressed
                BuildConfiguration.bUseSharedPCHs = false;

                // @todo clang: PCH files aren't supported by "clang-cl" yet (no /Yc support, and "-x c++-header" cannot be specified)
                if (WindowsPlatform.bUseVCCompilerArgs)
                {
                    BuildConfiguration.bUsePCHFiles = false;
                }
            }
        }
Beispiel #15
0
        public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
        {
            if (BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Mac)
            {
                // @todo: Temporarily disable precompiled header files when building remotely due to errors
                BuildConfiguration.bUsePCHFiles = false;
            }
            BuildConfiguration.bCheckExternalHeadersForModification = BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Mac;
            BuildConfiguration.bCheckSystemHeadersForModification   = BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Mac;
            BuildConfiguration.ProcessorCountMultiplier             = MacToolChain.GetAdjustedProcessorCountMultiplier();
            BuildConfiguration.bUseSharedPCHs = false;

            // we always deploy - the build machines need to be able to copy the files back, which needs the full bundle
            BuildConfiguration.bDeployAfterCompile = true;
        }
		public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
		{
			if (BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Mac)
			{
				// @todo: Temporarily disable precompiled header files when building remotely due to errors
				BuildConfiguration.bUsePCHFiles = false;
			}
			BuildConfiguration.bCheckExternalHeadersForModification = BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Mac;
			BuildConfiguration.bCheckSystemHeadersForModification = BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Mac;
			BuildConfiguration.ProcessorCountMultiplier = MacToolChain.GetAdjustedProcessorCountMultiplier();
			BuildConfiguration.bUseSharedPCHs = false;

			BuildConfiguration.bUsePDBFiles = bCreateDebugInfo && Configuration != CPPTargetConfiguration.Debug && Platform == CPPTargetPlatform.Mac && BuildConfiguration.bGeneratedSYMFile;

			// we always deploy - the build machines need to be able to copy the files back, which needs the full bundle
			BuildConfiguration.bDeployAfterCompile = true;
		}
Beispiel #17
0
        public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
        {
            if (WindowsPlatform.bCompileWithClang)
            {
                // @todo clang: Shared PCHs don't work on clang yet because the PCH will have definitions assigned to different values
                // than the consuming translation unit.  Unlike the warning in MSVC, this is a compile in Clang error which cannot be suppressed
                BuildConfiguration.bUseSharedPCHs = false;

                // @todo clang: PCH files aren't supported by "clang-cl" yet (no /Yc support, and "-x c++-header" cannot be specified)
                if (WindowsPlatform.bUseVCCompilerArgs)
                {
                    BuildConfiguration.bUsePCHFiles = false;
                }
            }

            // A bug in the UCRT can cause XGE to hang on VS2015 builds. Figure out if this hang is likely to effect this build and workaround it if able.
            if (WindowsPlatform.Compiler == WindowsCompiler.VisualStudio2015)
            {
                if (BuildConfiguration.bAllowXGE)
                {
                    // @todo: There is a KB coming that will fix this. Once that KB is available, test if it is present. Stalls will not be a problem if it is.

                    // Stalls are possible. However there is a workaround in XGE build 1659 and newer that can avoid the issue.
                    string XGEVersion = (string)Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Xoreax\IncrediBuild\Builder", "Version", null);
                    if (XGEVersion != null)
                    {
                        int XGEBuildNumber;
                        if (Int32.TryParse(XGEVersion, out XGEBuildNumber))
                        {
                            // Per Xoreax support, subtract 1001000 from the registry value to get the build number of the installed XGE.
                            if (XGEBuildNumber - 1001000 >= 1659)
                            {
                                BuildConfiguration.bXGENoWatchdogThread = true;
                            }
                            // @todo: Stalls are possible and we don't have a workaround. What should we do? Most people still won't encounter stalls, we don't really
                            // want to disable XGE on them if it would have worked.
                        }
                    }
                }
            }
        }
Beispiel #18
0
        public void SetUpProjectEnvironment(CPPTargetConfiguration Configuration)
        {
            UnrealTargetConfiguration unrealConfiguration;

            switch (Configuration)
            {
            case CPPTargetConfiguration.Shipping:
                unrealConfiguration = UnrealTargetConfiguration.Shipping;
                break;

            case CPPTargetConfiguration.Development:
                unrealConfiguration = UnrealTargetConfiguration.Development;
                break;

            default:
                unrealConfiguration = UnrealTargetConfiguration.DebugGame;
                break;
            }

            SetUpProjectEnvironment(unrealConfiguration);
        }
Beispiel #19
0
        public virtual string GetArchitectureArgument(CPPTargetConfiguration Configuration, string UBTArchitecture)
        {
            SetUpProjectEnvironment(Configuration);

            // get the list of architectures to compile
            string Archs =
                UBTArchitecture == "-simulator" ? "i386" :
                (Configuration == CPPTargetConfiguration.Shipping) ? ShippingArchitectures : NonShippingArchitectures;

            Log.TraceLogOnce("Compiling with these architectures: " + Archs);

            // parse the string
            string[] Tokens = Archs.Split(",".ToCharArray());

            string Result = "";

            foreach (string Token in Tokens)
            {
                Result += " -arch " + Token;
            }

            return(Result);
        }
		public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
		{
			// check the base first
			base.ValidateBuildConfiguration(Configuration, Platform, bCreateDebugInfo);

			BuildConfiguration.bUsePCHFiles = false;
			BuildConfiguration.bUseSharedPCHs = false;
			BuildConfiguration.bCheckExternalHeadersForModification = false;
			BuildConfiguration.bCheckSystemHeadersForModification = false;
			BuildConfiguration.ProcessorCountMultiplier = IOSToolChain.GetAdjustedProcessorCountMultiplier();
			BuildConfiguration.bDeployAfterCompile = true;
		}
 /** Copy constructor. */
 public CPPEnvironmentConfiguration(CPPEnvironmentConfiguration InCopyEnvironment)
 {
     OutputDirectory                        = InCopyEnvironment.OutputDirectory;
     LocalShadowDirectory                   = InCopyEnvironment.LocalShadowDirectory;
     PCHHeaderNameInCode                    = InCopyEnvironment.PCHHeaderNameInCode;
     PrecompiledHeaderIncludeFilename       = InCopyEnvironment.PrecompiledHeaderIncludeFilename;
     PrecompiledHeaderAction                = InCopyEnvironment.PrecompiledHeaderAction;
     bForceIncludePrecompiledHeader         = InCopyEnvironment.bForceIncludePrecompiledHeader;
     TargetPlatform                         = InCopyEnvironment.TargetPlatform;
     TargetArchitecture                     = InCopyEnvironment.TargetArchitecture;
     TargetConfiguration                    = InCopyEnvironment.TargetConfiguration;
     bUseRTTI                               = InCopyEnvironment.bUseRTTI;
     bFasterWithoutUnity                    = InCopyEnvironment.bFasterWithoutUnity;
     MinFilesUsingPrecompiledHeaderOverride = InCopyEnvironment.MinFilesUsingPrecompiledHeaderOverride;
     bEnableExceptions                      = InCopyEnvironment.bEnableExceptions;
     bEnableInlining                        = InCopyEnvironment.bEnableInlining;
     OptimizeCode                           = InCopyEnvironment.OptimizeCode;
     bCreateDebugInfo                       = InCopyEnvironment.bCreateDebugInfo;
     bIsBuildingLibrary                     = InCopyEnvironment.bIsBuildingLibrary;
     bIsBuildingDLL                         = InCopyEnvironment.bIsBuildingDLL;
     CLRMode                                = InCopyEnvironment.CLRMode;
     IncludePaths                 .AddRange(InCopyEnvironment.IncludePaths);
     SystemIncludePaths           .AddRange(InCopyEnvironment.SystemIncludePaths);
     SystemDotNetAssemblyPaths    .AddRange(InCopyEnvironment.SystemDotNetAssemblyPaths);
     FrameworkAssemblyDependencies.AddRange(InCopyEnvironment.FrameworkAssemblyDependencies);
      			PrivateAssemblyDependencies  .AddRange(InCopyEnvironment.PrivateAssemblyDependencies);
     Definitions                  .AddRange(InCopyEnvironment.Definitions);
     AdditionalArguments                    = InCopyEnvironment.AdditionalArguments;
 }
Beispiel #22
0
 /**
  *	Validate configuration for this platform
  *	NOTE: This function can/will modify BuildConfiguration!
  *
  *	@param	InPlatform			The CPPTargetPlatform being built
  *	@param	InConfiguration		The CPPTargetConfiguration being built
  *	@param	bInCreateDebugInfo	true if debug info is getting create, false if not
  */
 public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
 {
     UEBuildConfiguration.bCompileSimplygon = false;
 }
Beispiel #23
0
 /**
  *	Validate configuration for this platform
  *	NOTE: This function can/will modify BuildConfiguration!
  *
  *	@param	InPlatform			The CPPTargetPlatform being built
  *	@param	InConfiguration		The CPPTargetConfiguration being built
  *	@param	bInCreateDebugInfo	true if debug info is getting create, false if not
  */
 public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
 {
     UEBuildConfiguration.bCompileSimplygon = false;
 }
Beispiel #24
0
		static string GetArchitectureArgument(CPPTargetConfiguration Configuration, string UBTArchitecture)
		{
			IOSPlatform BuildPlat = UEBuildPlatform.GetBuildPlatform(UnrealTargetPlatform.IOS) as IOSPlatform;
			BuildPlat.SetUpProjectEnvironment(UnrealTargetPlatform.IOS);

			// get the list of architectures to compile
			string Archs =
				UBTArchitecture == "-simulator" ? "i386" :
				(Configuration == CPPTargetConfiguration.Shipping) ? IOSPlatform.ShippingArchitectures : IOSPlatform.NonShippingArchitectures;

			if (!bHasPrinted)
			{
				bHasPrinted = true;
				Console.WriteLine("Compiling with these architectures: " + Archs);
			}

			// parse the string
			string[] Tokens = Archs.Split(",".ToCharArray());

			string Result = "";
			foreach (string Token in Tokens)
			{
				Result += " -arch " + Token;
			}

			return Result;
		}
        /** Accesses the bin directory for the VC toolchain for the specified platform. */
        static string GetVCToolPath(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration, string ToolName)
        {
            // Initialize environment variables required for spawned tools.
            InitializeEnvironmentVariables(Platform);

            // Out variable that is going to contain fully qualified path to executable upon return.
            string VCToolPath = "";

            // is target 64-bit?
            bool bIsTarget64Bit = true;

            // We need to differentiate between 32 and 64 bit toolchain on Windows.
            {
                // rc.exe resides in the Windows SDK folder.
                if (ToolName.ToUpperInvariant() == "RC")
                {
                    // 64 bit -- we can use the 32 bit version to target 64 bit on 32 bit OS.
                    if (bIsTarget64Bit)
                    {
                        VCToolPath = Path.Combine(WindowsSDKDir, "bin/x64/rc.exe");
                    }
                    // 32 bit
                    else
                    {
                        VCToolPath = Path.Combine(WindowsSDKDir, "bin/x86/rc.exe");
                    }
                }
                // cl.exe and link.exe are found in the toolchain specific folders (32 vs. 64 bit). We do however use the 64 bit linker if available
                // even when targeting 32 bit as it's noticeably faster.
                else
                {
                    // Grab path to Visual Studio binaries from the system environment
                    string BaseVSToolPath = WindowsPlatform.GetVSComnToolsPath(WindowsCompiler.VisualStudio2012);
                    if (string.IsNullOrEmpty(BaseVSToolPath))
                    {
                        throw new BuildException("Visual Studio 2012 must be installed in order to build this target.");
                    }

                    if (Platform == CPPTargetPlatform.WinRT_ARM)
                    {
                        VCToolPath = Path.Combine(BaseVSToolPath, "../../VC/bin/x86_arm/" + ToolName + ".exe");
                    }
                    else
                    {
                        VCToolPath = Path.Combine(BaseVSToolPath, "../../VC/bin/amd64/" + ToolName + ".exe");
                    }
                }
            }

            return VCToolPath;
        }
 public TargetInfo(TargetInfo Target)
 {
     Platform      = Target.Platform;
     Architecture  = Target.Architecture;
     Configuration = Target.Configuration;
 }
Beispiel #27
0
 public bool IsBitcodeCompilingEnabled(CPPTargetConfiguration Configuration)
 {
     return(Configuration == CPPTargetConfiguration.Shipping && bShipForBitcode);
 }
Beispiel #28
0
 /**
  *	Whether PDB files should be used
  *
  *	@param	InPlatform			The CPPTargetPlatform being built
  *	@param	InConfiguration		The CPPTargetConfiguration being built
  *	@param	bInCreateDebugInfo	true if debug info is getting create, false if not
  *
  *	@return	bool	true if PDB files should be used, false if not
  */
 public virtual bool ShouldUsePDBFiles(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration, bool bCreateDebugInfo)
 {
     return false;
 }
Beispiel #29
0
 /**
  *	Validate configuration for this platform
  *	NOTE: This function can/will modify BuildConfiguration!
  *
  *	@param	InPlatform			The CPPTargetPlatform being built
  *	@param	InConfiguration		The CPPTargetConfiguration being built
  *	@param	bInCreateDebugInfo	true if debug info is getting create, false if not
  */
 public virtual void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
 {
 }
Beispiel #30
0
 /**
  *	Whether PCH files should be used
  *
  *	@param	InPlatform			The CPPTargetPlatform being built
  *	@param	InConfiguration		The CPPTargetConfiguration being built
  *
  *	@return	bool				true if PCH files should be used, false if not
  */
 public virtual bool ShouldUsePCHFiles(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration)
 {
     return BuildConfiguration.bUsePCHFiles;
 }
Beispiel #31
0
 /**
  *	Whether incremental linking should be used
  *
  *	@param	InPlatform			The CPPTargetPlatform being built
  *	@param	InConfiguration		The CPPTargetConfiguration being built
  *
  *	@return	bool	true if incremental linking should be used, false if not
  */
 public virtual bool ShouldUseIncrementalLinking(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration)
 {
     return false;
 }
Beispiel #32
0
        static string GetArchitectureArgument(CPPTargetConfiguration Configuration, string UBTArchitecture)
        {
            // get the list of architectures to compile
            string Archs =
                UBTArchitecture == "-simulator" ? "i386" :
                (Configuration == CPPTargetConfiguration.Shipping) ? ShippingArchitectures : NonShippingArchitectures;

            if (!bHasPrinted)
            {
                bHasPrinted = true;
                Console.WriteLine("Compiling with these architectures: " + Archs);
            }

            // parse the string
            string[] Tokens = Archs.Split(",".ToCharArray());

            string Result = "";
            foreach (string Token in Tokens)
            {
                Result += " -arch " + Token;
            }

            return Result;
        }
Beispiel #33
0
        static string GetSharedArguments_Global(CPPTargetConfiguration TargetConfiguration, string Architecture, bool bEnableShadowVariableWarning)
        {
            string Result = " ";

            if (Architecture == "-win32")             // simulator
            {
                return(Result);
            }

//			Result += " -funsigned-char";
//			Result += " -fno-strict-aliasing";
            Result += " -fno-exceptions";
//			Result += " -fno-short-enums";

            Result += " -Wno-unused-value";                               // appErrorf triggers this
            Result += " -Wno-switch";                                     // many unhandled cases
            Result += " -Wno-tautological-constant-out-of-range-compare"; // disables some warnings about comparisons from TCHAR being a char
            // this hides the "warning : comparison of unsigned expression < 0 is always false" type warnings due to constant comparisons, which are possible with template arguments
            Result += " -Wno-tautological-compare";
            Result += " -Wno-inconsistent-missing-override";    // as of 1.35.0, overriding a member function but not marked as 'override' triggers warnings
            Result += " -Wno-expansion-to-defined";             // 1.36.11
            Result += " -Wno-undefined-var-template";           // 1.36.11
            Result += " -Wno-nonportable-include-path";         // 1.36.11

            // okay, in UE4, we'd fix the code for these, but in UE3, not worth it
            Result += " -Wno-logical-op-parentheses";   // appErrorf triggers this
            Result += " -Wno-array-bounds";             // some VectorLoads go past the end of the array, but it's okay in that case
            // needed to suppress warnings about using offsetof on non-POD types.
            Result += " -Wno-invalid-offsetof";
            // we use this feature to allow static FNames.
            Result += " -Wno-gnu-string-literal-operator-template";

            if (bEnableShadowVariableWarning)
            {
                Result += " -Wshadow" + (BuildConfiguration.bShadowVariableErrors ? "" : " -Wno-error=shadow");
            }

            // JavsScript option overrides (see src/settings.js)

            // we have to specify the full amount of memory with Asm.JS (1.5 G)
            // I wonder if there's a per game way to change this.
            int TotalMemory = 256 * 1024 * 1024;

            Result += " -s TOTAL_MEMORY=" + TotalMemory.ToString();

            // no need for exceptions
            Result += " -s DISABLE_EXCEPTION_CATCHING=1";
            // enable checking for missing functions at link time as opposed to runtime
            Result += " -s WARN_ON_UNDEFINED_SYMBOLS=1";

            // enable hardware accelerated and advanced instructions/functions
//			Result += " -s USE_WEBGL2=1 -s FULL_ES3=1";
            Result += " -s FULL_ES2=1";
//			Result += " -msse";
//			Result += " -msse2";
//			Result += " -s SIMD=1";
//			Result += " -s USE_PTHREADS=1"; // 2:polyfill -- SharedInt\d+Array available by ES7

            // THESE ARE TEST/DEBUGGING
//			Environment.SetEnvironmentVariable("EMCC_DEBUG", "1");
//			Environment.SetEnvironmentVariable("EMCC_CORES", "8");
//			Environment.SetEnvironmentVariable("EMCC_OPTIMIZE_NORMALLY", "1");

            // export console command handler. Export main func too because default exports ( e.g Main ) are overridden if we use custom exported functions.
            Result += " -s EXPORTED_FUNCTIONS=\"['_main', '_on_fatal']\"";

            // NOTE: This may slow down the compiler's startup time!
            {
                Result += " -s NO_EXIT_RUNTIME=1 --memory-init-file 1";
            }

            if (bEnableTracing)
            {
                Result += " --tracing";
            }
            return(Result);
        }
 /**
  *	Validate configuration for this platform
  *	NOTE: This function can/will modify BuildConfiguration!
  *
  *	@param	InPlatform			The CPPTargetPlatform being built
  *	@param	InConfiguration		The CPPTargetConfiguration being built
  *	@param	bInCreateDebugInfo	true if debug info is getting create, false if not
  */
 public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
 {
     // increase Unity size to avoid too long command lines
     BuildConfiguration.NumIncludedBytesPerUnityCPP = 1024 * 1024;
 }
Beispiel #35
0
        public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
        {
            // @todo clang: PCH files aren't supported by "clang-cl" yet (no /Yc support, and "-x c++-header" cannot be specified)
			// @todo clang: PCH files with regular Clang on Windows have bugs with pack alignment and segfaults occasionally
            if( WindowsPlatform.bCompileWithClang )
            {
                BuildConfiguration.bUsePCHFiles = false;
                BuildConfiguration.bUseSharedPCHs = false;
            }
        }
Beispiel #36
0
        public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
        {
            //			BuildConfiguration.bUsePCHFiles = false;
            BuildConfiguration.bCheckExternalHeadersForModification = ExternalExecution.GetRuntimePlatform() != UnrealTargetPlatform.Mac;
            BuildConfiguration.bCheckSystemHeadersForModification = ExternalExecution.GetRuntimePlatform() != UnrealTargetPlatform.Mac;
            BuildConfiguration.ProcessorCountMultiplier = MacToolChain.GetAdjustedProcessorCountMultiplier();
            BuildConfiguration.bUseSharedPCHs = false;

            // we always deploy - the build machines need to be able to copy the files back, which needs the full bundle
            BuildConfiguration.bDeployAfterCompile = true;
        }
Beispiel #37
0
 public TargetInfo(TargetInfo Target)
 {
     Platform      = Target.Platform;
     Architecture  = Target.Architecture;
     Configuration = Target.Configuration;
 }
Beispiel #38
0
 /**
  *	Whether incremental linking should be used
  *	
  *	@param	InPlatform			The CPPTargetPlatform being built
  *	@param	InConfiguration		The CPPTargetConfiguration being built
  *	
  *	@return	bool	true if incremental linking should be used, false if not
  */
 public override bool ShouldUseIncrementalLinking(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration)
 {
     return (Configuration == CPPTargetConfiguration.Debug);
 }
Beispiel #39
0
 public override string GetArchitectureArgument(CPPTargetConfiguration Configuration, string UBTArchitecture)
 {
     // TV is only arm64
     return(" -arch " + (UBTArchitecture == "-simulator" ? "i386" : "arm64"));
 }
Beispiel #40
0
        public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
        {
            if( WindowsPlatform.bCompileWithClang )
            {
				// @todo clang: Shared PCHs don't work on clang yet because the PCH will have definitions assigned to different values
				// than the consuming translation unit.  Unlike the warning in MSVC, this is a compile in Clang error which cannot be suppressed
                BuildConfiguration.bUseSharedPCHs = false;

	            // @todo clang: PCH files aren't supported by "clang-cl" yet (no /Yc support, and "-x c++-header" cannot be specified)
 				if( WindowsPlatform.bUseVCCompilerArgs )
				{
                	BuildConfiguration.bUsePCHFiles = false;
				}
            }
        }
 /** Copy constructor. */
 public LinkEnvironmentConfiguration(LinkEnvironmentConfiguration InCopyEnvironment)
 {
     OutputDirectory = InCopyEnvironment.OutputDirectory;
     IntermediateDirectory = InCopyEnvironment.IntermediateDirectory;
     LocalShadowDirectory = InCopyEnvironment.LocalShadowDirectory;
     OutputFilePath = InCopyEnvironment.OutputFilePath;
     TargetPlatform = InCopyEnvironment.TargetPlatform;
     TargetConfiguration = InCopyEnvironment.TargetConfiguration;
     TargetArchitecture = InCopyEnvironment.TargetArchitecture;
     LibraryPaths.AddRange(InCopyEnvironment.LibraryPaths);
     ExcludedLibraries.AddRange(InCopyEnvironment.ExcludedLibraries);
     AdditionalLibraries.AddRange(InCopyEnvironment.AdditionalLibraries);
     Frameworks.AddRange(InCopyEnvironment.Frameworks);
     AdditionalFrameworks.AddRange(InCopyEnvironment.AdditionalFrameworks);
     WeakFrameworks.AddRange(InCopyEnvironment.WeakFrameworks);
     DelayLoadDLLs.AddRange(InCopyEnvironment.DelayLoadDLLs);
     AdditionalArguments = InCopyEnvironment.AdditionalArguments;
     bCreateDebugInfo = InCopyEnvironment.bCreateDebugInfo;
     CLRMode = InCopyEnvironment.CLRMode;
     bIsBuildingLibrary = InCopyEnvironment.bIsBuildingLibrary;
     bIsBuildingDLL = InCopyEnvironment.bIsBuildingDLL;
     bIsBuildingConsoleApplication = InCopyEnvironment.bIsBuildingConsoleApplication;
     bBuildAdditionalConsoleApplication = InCopyEnvironment.bBuildAdditionalConsoleApplication;
     WindowsEntryPointOverride = InCopyEnvironment.WindowsEntryPointOverride;
     bIsCrossReferenced = InCopyEnvironment.bIsCrossReferenced;
     bHasExports = InCopyEnvironment.bHasExports;
     bIsBuildingDotNetAssembly = InCopyEnvironment.bIsBuildingDotNetAssembly;
 }
Beispiel #42
0
 /// <summary>
 /// Whether PCH files should be used
 /// </summary>
 /// <param name="InPlatform">  The CPPTargetPlatform being built</param>
 /// <param name="InConfiguration"> The CPPTargetConfiguration being built</param>
 /// <returns>bool    true if PCH files should be used, false if not</returns>
 public override bool ShouldUsePCHFiles(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration)
 {
     return(false);
 }
		public override bool ShouldUsePCHFiles(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration)
		{
			return true;
		}
Beispiel #44
0
        /** Accesses the bin directory for the VC toolchain for the specified platform. */
        static string GetVCToolPath(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration, string ToolName)
        {
            // Initialize environment variables required for spawned tools.
            InitializeEnvironmentVariables( Platform );

            // Out variable that is going to contain fully qualified path to executable upon return.
            string VCToolPath = "";

            // rc.exe resides in the Windows SDK folder.
            if (ToolName.ToUpperInvariant() == "RC")
            {
                // 64 bit -- we can use the 32 bit version to target 64 bit on 32 bit OS.
                if (Platform == CPPTargetPlatform.Win64)
                {
                    VCToolPath = Path.Combine(WindowsSDKDir, "bin/x64/rc.exe");
                }
                // 32 bit
                else
                {
                    if( !WindowsPlatform.SupportWindowsXP )	// Windows XP requires use to force Windows SDK 7.1 even on the newer compiler, so we need the old path RC.exe
                    {
                        VCToolPath = Path.Combine( WindowsSDKDir, "bin/x86/rc.exe" );
                    }
                    else
                    {
                        VCToolPath = Path.Combine( WindowsSDKDir, "bin/rc.exe" );
                    }
                }
            }
            // cl.exe and link.exe are found in the toolchain specific folders (32 vs. 64 bit)
            else
            {
                bool bIsRequestingLinkTool = ToolName.Equals( "link", StringComparison.InvariantCultureIgnoreCase );
                bool bIsRequestingLibTool = ToolName.Equals( "lib", StringComparison.InvariantCultureIgnoreCase );

                // If we were asked to use Clang, then we'll redirect the path to the compiler to the LLVM installation directory
                if( WindowsPlatform.bCompileWithClang && !bIsRequestingLinkTool && !bIsRequestingLibTool )
                {
                    VCToolPath = Path.Combine( Environment.GetFolderPath( Environment.SpecialFolder.ProgramFilesX86 ), "LLVM", "msbuild-bin", ToolName + ".exe" );
                    if( !File.Exists( VCToolPath ) )
                    {
                        throw new BuildException( "Clang was selected as the Windows compiler, but LLVM/Clang does not appear to be installed.  Could not find: " + VCToolPath );
                    }
                }
                else
                {
                    string BaseVSToolPath = FindBaseVSToolPath();

                    // Both target and build machines are 64 bit
                    bool bIs64Bit = (Platform == CPPTargetPlatform.Win64);
                    // Regardless of the target, if we're linking on a 64 bit machine, we want to use the 64 bit linker (it's faster than the 32 bit linker)
                    //@todo.WIN32: Using the 64-bit linker appears to be broken at the moment.
                    bool bUse64BitLinker = (Platform == CPPTargetPlatform.Win64) && bIsRequestingLinkTool;

                    // Use the 64 bit tools if the build machine and target are 64 bit or if we're linking a 32 bit binary on a 64 bit machine
                    if (bIs64Bit || bUse64BitLinker)
                    {
                        // Use the native 64-bit compiler if present, otherwise use the amd64-on-x86 compiler. VS2012 Express only includes the latter.
                        string PlatformToolPath = Path.Combine(BaseVSToolPath, "../../VC/bin/amd64/");
                        if(!Directory.Exists(PlatformToolPath))
                        {
                            PlatformToolPath = Path.Combine(BaseVSToolPath, "../../VC/bin/x86_amd64/");
                        }
                        VCToolPath = PlatformToolPath + ToolName + ".exe";
                    }
                    else
                    {
                        // Use 32 bit for cl.exe and other tools, or for link.exe if 64 bit path doesn't exist and we're targeting 32 bit.
                        VCToolPath = Path.Combine(BaseVSToolPath, "../../VC/bin/" + ToolName + ".exe");
                    }
                }
            }

            return VCToolPath;
        }
Beispiel #45
0
 /// <summary>
 /// Whether incremental linking should be used
 /// </summary>
 /// <param name="InPlatform">  The CPPTargetPlatform being built</param>
 /// <param name="InConfiguration"> The CPPTargetConfiguration being built</param>
 /// <returns>bool true if incremental linking should be used, false if not</returns>
 public override bool ShouldUseIncrementalLinking(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration)
 {
     return(Configuration == CPPTargetConfiguration.Debug);
 }
        static string GetSharedArguments_Global(CPPTargetConfiguration TargetConfiguration, string Architecture)
        {
            string Result = " ";

            if (Architecture == "-win32")
            {
                return Result;
            }

            // 			Result += " -funsigned-char";
            // 			Result += " -fno-strict-aliasing";
            Result += " -fno-exceptions";
            // 			Result += " -fno-short-enums";

            Result += " -Wno-unused-value"; // appErrorf triggers this
            Result += " -Wno-switch"; // many unhandled cases
            Result += " -Wno-tautological-constant-out-of-range-compare"; // disables some warnings about comparisons from TCHAR being a char
            // this hides the "warning : comparison of unsigned expression < 0 is always false" type warnings due to constant comparisons, which are possible with template arguments
            Result += " -Wno-tautological-compare";

            // okay, in UE4, we'd fix the code for these, but in UE3, not worth it
            Result += " -Wno-logical-op-parentheses"; // appErrorf triggers this
            Result += " -Wno-array-bounds"; // some VectorLoads go past the end of the array, but it's okay in that case
            Result += " -Wno-invalid-offsetof"; // too many warnings kills windows clang.

            // JavsScript option overrides (see src/settings.js)

            // we have to specify the full amount of memory with Asm.JS (1.5 G)
            // I wonder if there's a per game way to change this.
            Result += " -s TOTAL_MEMORY=1610612736";

            // no need for exceptions
            Result += " -s DISABLE_EXCEPTION_CATCHING=1";
            // enable checking for missing functions at link time as opposed to runtime
            Result += " -s WARN_ON_UNDEFINED_SYMBOLS=1";
            // we want full ES2
            Result += " -s FULL_ES2=1 ";
            // don't need UTF8 string support, and it slows string ops down
            Result += " -s UTF_STRING_SUPPORT=0";
            Result += "  ";

            if (TargetConfiguration == CPPTargetConfiguration.Debug)
            {
                Result += " -O0";
            }
            if (TargetConfiguration == CPPTargetConfiguration.Debug || TargetConfiguration == CPPTargetConfiguration.Development)
            {
                Result += " -s GL_ASSERTIONS=1 ";
            }
            if (TargetConfiguration == CPPTargetConfiguration.Development)
            {
                Result += " -O2 -s ASM_JS=1 -s OUTLINING_LIMIT=110000";
            }
            if (TargetConfiguration == CPPTargetConfiguration.Shipping)
            {
                Result += " -O2 -s ASM_JS=1 -s OUTLINING_LIMIT=110000";
            }

            // NOTE: This may slow down the compiler's startup time!
            if ( !bEnableFastIteration )
            {
                Result += " --memory-init-file 1";
            }

            return Result;
        }
Beispiel #47
0
 /**
  *	Whether PDB files should be used
  *
  *	@param	InPlatform			The CPPTargetPlatform being built
  *	@param	InConfiguration		The CPPTargetConfiguration being built
  *	@param	bInCreateDebugInfo	true if debug info is getting create, false if not
  *
  *	@return	bool	true if PDB files should be used, false if not
  */
 public override bool ShouldUsePDBFiles(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration, bool bCreateDebugInfo)
 {
     return true;
 }
		public bool IsBitcodeCompilingEnabled(CPPTargetConfiguration Configuration)
		{
			return Configuration == CPPTargetConfiguration.Shipping && bShipForBitcode;
		}
Beispiel #49
0
 /**
  *	Whether PDB files should be used
  *	
  *	@param	InPlatform			The CPPTargetPlatform being built
  *	@param	InConfiguration		The CPPTargetConfiguration being built
  *	@param	bInCreateDebugInfo	true if debug info is getting create, false if not
  *	
  *	@return	bool	true if PDB files should be used, false if not
  */
 public override bool ShouldUsePDBFiles(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration, bool bCreateDebugInfo)
 {
     // Only supported on PC.
     if (bCreateDebugInfo && ShouldUseIncrementalLinking(Platform, Configuration))
     {
         return true;
     }
     return false;
 }
		public virtual string GetArchitectureArgument(CPPTargetConfiguration Configuration, string UBTArchitecture)
		{
			SetUpProjectEnvironment(Configuration);

            // get the list of architectures to compile
            string Archs =
				UBTArchitecture == "-simulator" ? "i386" :
				(Configuration == CPPTargetConfiguration.Shipping) ? ShippingArchitectures : NonShippingArchitectures;

			Log.TraceLogOnce("Compiling with these architectures: " + Archs);

			// parse the string
			string[] Tokens = Archs.Split(",".ToCharArray());

			string Result = "";
			foreach (string Token in Tokens)
			{
				Result += " -arch " + Token;
			}

			return Result;
		}
Beispiel #51
0
 /// <summary>
 /// Whether PDB files should be used
 /// </summary>
 /// <param name="InPlatform">  The CPPTargetPlatform being built</param>
 /// <param name="InConfiguration"> The CPPTargetConfiguration being built</param>
 /// <param name="bInCreateDebugInfo">true if debug info is getting create, false if not</param>
 /// <returns>bool true if PDB files should be used, false if not</returns>
 public override bool ShouldUsePDBFiles(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration, bool bCreateDebugInfo)
 {
     return(bCreateDebugInfo);
 }
        public void SetUpProjectEnvironment(CPPTargetConfiguration Configuration)
        {
            UnrealTargetConfiguration unrealConfiguration;

            switch (Configuration)
            {
                case CPPTargetConfiguration.Shipping:
                    unrealConfiguration = UnrealTargetConfiguration.Shipping;
                    break;
                case CPPTargetConfiguration.Development:
                    unrealConfiguration = UnrealTargetConfiguration.Development;
                    break;
                default:
                    unrealConfiguration = UnrealTargetConfiguration.DebugGame;
                    break;
            }

            SetUpProjectEnvironment(unrealConfiguration);
        }
        /// <summary>
        /// Validates the configuration. E.g. some options are mutually exclusive whereof some imply others. Also
        /// some functionality is not available on all platforms.
        /// @warning: the order of validation is important
        /// </summary>
        /// <param name="Configuration">Current configuration (e.g. development, debug, ...)</param>
        /// <param name="Platform">Current platform (e.g. Win32, PS3, ...)</param>
        /// <param name="bCreateDebugInfo">True if debug info should be created</param>
        public static void ValidateConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
        {
            var BuildPlatform = UEBuildPlatform.GetBuildPlatformForCPPTargetPlatform(Platform);

            // E&C support.
            if( bSupportEditAndContinue )
            {
                bUseIncrementalLinking = BuildPlatform.ShouldUseIncrementalLinking(Platform, Configuration);
            }

            // Incremental linking.
            if (bUseIncrementalLinking)
            {
                bUsePDBFiles = BuildPlatform.ShouldUsePDBFiles(Platform, Configuration, bCreateDebugInfo);
            }

            // Detailed stats
            if (bLogDetailedActionStats && bAllowXGE)
            {
                // Some build machines apparently have this turned on, so if you really want detailed stats, don't run with XGE
                bLogDetailedActionStats = false;
            }

            if (UnrealBuildTool.RunningRocket())
            {
                bAllowXGE = false;
            }

            // PDB
            if (bUsePDBFiles)
            {
                // NOTE: Currently we allow XGE to run, even with PDBs, until we notice an issue with this
                bool bDisallowXGEWithPDBFiles = false;
                if (bDisallowXGEWithPDBFiles)
                {
                    // Force local execution as we have one PDB for all files using the same PCH. This currently doesn't
                    // scale well with XGE due to required networking bandwidth. Xoreax mentioned that this was going to
                    // be fixed in a future version of the software.
                    bAllowXGE = false;
                }
            }

            // Allow for the build platform to perform custom validation here...
            // NOTE: This CAN modify the static BuildConfiguration settings!!!!
            BuildPlatform.ValidateBuildConfiguration(Configuration, Platform, bCreateDebugInfo);

            if (!BuildPlatform.CanUseXGE())
            {
                bAllowXGE = false;
            }

            if (!BuildPlatform.CanUseDistcc())
            {
                bAllowDistcc = false;
            }
        }
Beispiel #54
0
 public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
 {
     // @todo clang: PCH files aren't quite working yet with "clang-cl" (no /Yc support, and "-x c++-header" cannot be specified)
     if (WindowsPlatform.bCompileWithClang)
     {
         BuildConfiguration.bUsePCHFiles = false;
         BuildConfiguration.bUseSharedPCHs = false;
     }
 }