コード例 #1
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);
        }