Example #1
0
        static string GetLinkArguments(LinkEnvironment LinkEnvironment, string Architecture)
        {
            string Result = "";

            Result += " -nostdlib";
            Result += " -Wl,-shared,-Bsymbolic";
            Result += " -Wl,--no-undefined";

            if (UnrealBuildTool.BuildingRocket())
            {
                Result += " -Wl,--strip-debug";
            }

            if (Architecture == "-armv7")
            {
                Result += ToolchainParamsArm;
                Result += " -march=armv7-a";
                Result += " -Wl,--fix-cortex-a8";                               // required to route around a CPU bug in some Cortex-A8 implementations
            }
            else if (Architecture == "-x86")
            {
                Result += ToolchainParamsx86;
                Result += " -march=atom";
            }

            // verbose output from the linker
            // Result += " -v";

            return(Result);
        }
Example #2
0
        static string GetLinkArguments(LinkEnvironment LinkEnvironment)
        {
            string Result = "";

            // debugging symbols
            if (LinkEnvironment.Config.Target.Configuration < CPPTargetConfiguration.Shipping)
            {
                Result += " -rdynamic";   // needed for backtrace_symbols()...
            }
            else
            {
                Result += " -s"; // Strip binaries in Shipping
            }
            if (LinkEnvironment.Config.bIsBuildingDLL)
            {
                Result += " -shared";
            }
            else
            {
                // ignore unresolved symbols in shared libs
                Result += string.Format(" -Wl,--unresolved-symbols=ignore-in-shared-libs");
            }

            if (UnrealBuildTool.BuildingRocket())
            {
                // strip symbols for Rocket in every configuration
                Result += " -Wl,-s";
            }

            // RPATH for third party libs
            Result += " -Wl,-rpath=${ORIGIN}";
            Result += " -Wl,-rpath-link=${ORIGIN}";
            Result += " -Wl,-rpath=${ORIGIN}/../../../Engine/Binaries/Linux";
            Result += " -Wl,-rpath=${ORIGIN}/..";               // for modules that are in sub-folders of the main Engine/Binary/Linux folder
            // FIXME: really ugly temp solution. Modules need to be able to specify this
            Result += " -Wl,-rpath=${ORIGIN}/../../../Engine/Binaries/ThirdParty/ICU/icu4c-53_1/Linux/x86_64-unknown-linux-gnu";

            if (CrossCompiling())
            {
                if (UsingClang())
                {
                    Result += String.Format(" -target {0}", LinkEnvironment.Config.Target.Architecture);        // Set target triple
                }
                string SysRootPath = BaseLinuxPath.TrimEnd(new char[] { '\\', '/' });
                Result += String.Format(" \"--sysroot={0}\"", SysRootPath);
            }

            return(Result);
        }
Example #3
0
        /**
         *	Register the platform with the UEBuildPlatform class
         */
        protected override void RegisterBuildPlatformInternal()
        {
            //@todo.Rocket: Add platform support
            if (UnrealBuildTool.RunningRocket() || UnrealBuildTool.BuildingRocket() || Utils.IsRunningOnMono)
            {
                return;
            }

            if ((ProjectFileGenerator.bGenerateProjectFiles == true) || (IsVisualStudioInstalled() == true))
            {
                bool bRegisterBuildPlatform = true;

                // We also need to check for the generated projects... to handle the case where someone generates projects w/out WinRT.
                // Hardcoding this for now - but ideally it would be dynamically discovered.
                string EngineSourcePath = Path.Combine(ProjectFileGenerator.EngineRelativePath, "Source");
                string WinRTRHIFile     = Path.Combine(EngineSourcePath, "Runtime", "Windows", "D3D11RHI", "D3D11RHI.build.cs");
                if (File.Exists(WinRTRHIFile) == false)
                {
                    bRegisterBuildPlatform = false;
                }

                if (bRegisterBuildPlatform == true)
                {
                    // Register this build platform for WinRT
                    Log.TraceVerbose("        Registering for {0}", UnrealTargetPlatform.WinRT.ToString());
                    UEBuildPlatform.RegisterBuildPlatform(UnrealTargetPlatform.WinRT, this);
                    UEBuildPlatform.RegisterPlatformWithGroup(UnrealTargetPlatform.WinRT, UnrealPlatformGroup.Microsoft);

                    // For now only register WinRT_ARM is truly a Windows 8 machine.
                    // This will prevent people who do all platform builds from running into the compiler issue.
                    if (WinRTPlatform.IsWindows8() == true)
                    {
                        Log.TraceVerbose("        Registering for {0}", UnrealTargetPlatform.WinRT_ARM.ToString());
                        UEBuildPlatform.RegisterBuildPlatform(UnrealTargetPlatform.WinRT_ARM, this);
                        UEBuildPlatform.RegisterPlatformWithGroup(UnrealTargetPlatform.WinRT_ARM, UnrealPlatformGroup.Microsoft);
                    }
                }
            }
        }
Example #4
0
        /**
         *	Register the platform with the UEBuildPlatform class
         */
        protected override void RegisterBuildPlatformInternal()
        {
            //@todo.Rocket: Add platform support
            if (UnrealBuildTool.RunningRocket() || UnrealBuildTool.BuildingRocket())
            {
                return;
            }

            // Make sure the SDK is installed
            if ((ProjectFileGenerator.bGenerateProjectFiles == true) || (HasRequiredSDKsInstalled() == SDKStatus.Valid))
            {
                bool bRegisterBuildPlatform = true;

                // make sure we have the HTML5 files; if not, then this user doesn't really have HTML5 access/files, no need to compile HTML5!
                string EngineSourcePath        = Path.Combine(ProjectFileGenerator.EngineRelativePath, "Source");
                string HTML5TargetPlatformFile = Path.Combine(EngineSourcePath, "Developer", "HTML5", "HTML5TargetPlatform", "HTML5TargetPlatform.Build.cs");
                if ((File.Exists(HTML5TargetPlatformFile) == false))
                {
                    bRegisterBuildPlatform = false;
                    Log.TraceWarning("Missing required components (.... HTML5TargetPlatformFile, others here...). Check source control filtering, or try resyncing.");
                }

                if (bRegisterBuildPlatform == true)
                {
                    // Register this build platform for HTML5
                    Log.TraceVerbose("        Registering for {0}", UnrealTargetPlatform.HTML5.ToString());
                    UEBuildPlatform.RegisterBuildPlatform(UnrealTargetPlatform.HTML5, this);
                    if (GetActiveArchitecture() == "-win32")
                    {
                        UEBuildPlatform.RegisterPlatformWithGroup(UnrealTargetPlatform.HTML5, UnrealPlatformGroup.Simulator);
                    }
                    else
                    {
                        UEBuildPlatform.RegisterPlatformWithGroup(UnrealTargetPlatform.HTML5, UnrealPlatformGroup.Device);
                    }
                }
            }
        }
Example #5
0
        static string GetCLArguments_Global(CPPEnvironment CompileEnvironment, string Architecture)
        {
            string Result = "";

            Result += (Architecture == "-armv7") ? ToolchainParamsArm : ToolchainParamsx86;

            // build up the commandline common to C and C++
            Result += " -c";
            Result += " -fdiagnostics-format=msvc";
            Result += " -Wall";

            Result += " -Wno-unused-variable";
            // this will hide the warnings about static functions in headers that aren't used in every single .cpp file
            Result += " -Wno-unused-function";
            // this hides the "enumeration value 'XXXXX' not handled in switch [-Wswitch]" warnings - we should maybe remove this at some point and add UE_LOG(, Fatal, ) to default cases
            Result += " -Wno-switch";
            // 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";
            //This will prevent the issue of warnings for unused private variables.
            Result += " -Wno-unused-private-field";
            Result += " -Wno-local-type-template-args";                 // engine triggers this
            Result += " -Wno-return-type-c-linkage";                    // needed for PhysX
            Result += " -Wno-reorder";                                  // member initialization order
            Result += " -Wno-unknown-pragmas";                          // probably should kill this one, sign of another issue in PhysX?
            Result += " -Wno-invalid-offsetof";                         // needed to suppress warnings about using offsetof on non-POD types.
            Result += " -Wno-logical-op-parentheses";                   // needed for external headers we can't change

            // new for clang4.5 warnings:
            if (ClangVersionFloat >= 3.5)
            {
                Result += " -Wno-undefined-bool-conversion";                 // 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true (if (this))
            }

            // shipping builds will cause this warning with "ensure", so disable only in those case
            if (CompileEnvironment.Config.Target.Configuration == CPPTargetConfiguration.Shipping)
            {
                Result += " -Wno-unused-value";
            }

            // debug info
            if (CompileEnvironment.Config.bCreateDebugInfo && !UnrealBuildTool.BuildingRocket())
            {
                Result += " -g2 -gdwarf-2";
            }

            // optimization level
            if (CompileEnvironment.Config.Target.Configuration == CPPTargetConfiguration.Debug)
            {
                Result += " -O0";
            }
            else
            {
                if (UEBuildConfiguration.bCompileForSize)
                {
                    Result += " -Oz";
                }
                else
                {
                    Result += " -O3";
                }
            }

            //@todo android: these are copied verbatim from UE3 and probably need adjustment
            if (Architecture == "-armv7")
            {
                //		Result += " -mthumb-interwork";			// Generates code which supports calling between ARM and Thumb instructions, w/o it you can't reliability use both together
                Result += " -funwind-tables";                                   // Just generates any needed static data, affects no code
                Result += " -fstack-protector";                                 // Emits extra code to check for buffer overflows
                //		Result += " -mlong-calls";				// Perform function calls by first loading the address of the function into a reg and then performing the subroutine call
                Result += " -fno-strict-aliasing";                              // Prevents unwanted or invalid optimizations that could produce incorrect code
                Result += " -fpic";                                             // Generates position-independent code (PIC) suitable for use in a shared library
                Result += " -fno-exceptions";                                   // Do not enable exception handling, generates extra code needed to propagate exceptions
                Result += " -fno-rtti";                                         //
                Result += " -fno-short-enums";                                  // Do not allocate to an enum type only as many bytes as it needs for the declared range of possible values
                //		Result += " -finline-limit=64";			// GCC limits the size of functions that can be inlined, this flag allows coarse control of this limit
                //		Result += " -Wno-psabi";				// Warn when G++ generates code that is probably not compatible with the vendor-neutral C++ ABI

                Result += " -march=armv7-a";
                Result += " -mfloat-abi=softfp";
                Result += " -mfpu=vfpv3-d16";                                   //@todo android: UE3 was just vfp. arm7a should all support v3 with 16 registers

                // Some switches interfere with on-device debugging
                if (CompileEnvironment.Config.Target.Configuration != CPPTargetConfiguration.Debug)
                {
                    Result += " -ffunction-sections";                       // Places each function in its own section of the output file, linker may be able to perform opts to improve locality of reference
                }

                Result += " -fsigned-char";                                             // Treat chars as signed //@todo android: any concerns about ABI compatibility with libs here?
            }
            else if (Architecture == "-x86")
            {
                Result += " -fstrict-aliasing";
                Result += " -fno-omit-frame-pointer";
                Result += " -fno-strict-aliasing";
                Result += " -fno-short-enums";
                Result += " -fno-exceptions";
                Result += " -fno-rtti";
                Result += " -march=atom";
            }

            return(Result);
        }