Ejemplo n.º 1
0
        protected string GetDsymutilPath()
        {
            FileReference DsymutilLocation = new FileReference("/usr/bin/dsymutil");

            DirectoryReference AutoSdkDir;

            if (UEBuildPlatformSDK.TryGetHostPlatformAutoSDKDir(out AutoSdkDir))
            {
                FileReference AutoSdkDsymutilLocation = FileReference.Combine(AutoSdkDir, "Mac", "LLVM", "bin", "dsymutil");
                if (FileReference.Exists(AutoSdkDsymutilLocation))
                {
                    DsymutilLocation = AutoSdkDsymutilLocation;
                }
            }

            return(DsymutilLocation.FullName);
        }
        protected string GetDsymutilPath(out string ExtraOptions, bool bIsForLTOBuild = false)
        {
            FileReference DsymutilLocation = new FileReference("/usr/bin/dsymutil");

            // dsymutil before 10.0.1 has a bug that causes issues, it's fixed in autosdks but not everyone has those set up so for the timebeing we have
            // a version in P4 - first determine if we need it
            string DsymutilVersionString = Utils.RunLocalProcessAndReturnStdOut(DsymutilLocation.FullName, "-version");

            bool bUseInstalledDsymutil = true;
            int  Major = 0, Minor = 0, Patch = 0;

            // tease out the version number
            string[] Tokens = DsymutilVersionString.Split(" ".ToCharArray());

            // sanity check
            if (Tokens.Length < 4 || Tokens[3].Contains(".") == false)
            {
                Log.TraceInformationOnce("Unable to parse dsymutil version out of: {0}", DsymutilVersionString);

                bUseInstalledDsymutil = false;
            }
            else
            {
                string[] Versions = Tokens[3].Split(".".ToCharArray());
                if (Versions.Length < 3)
                {
                    Log.TraceInformationOnce("Unable to parse version token: {0}", Tokens[3]);
                }
                else
                {
                    if (!int.TryParse(Versions[0], out Major) || !int.TryParse(Versions[1], out Minor) || !int.TryParse(Versions[2], out Patch))
                    {
                        Log.TraceInformationOnce("Unable to parse version tokens: {0}", Tokens[3]);
                    }
                    else
                    {
                        Log.TraceInformationOnce("Parsed dsymutil version as {0}.{1}.{2}", Major, Minor, Patch);

                        if (Major < 10 || (Minor == 0 && Patch == 0))
                        {
                            bUseInstalledDsymutil = false;
                        }
                    }
                }
            }

            // if the installed one is too old, use a fixed up one if it can
            if (bUseInstalledDsymutil == false)
            {
                FileReference PatchedDsymutilLocation = FileReference.Combine(UnrealBuildTool.EngineDirectory, "Binaries/Mac/NotForLicensees/LLVM/bin/dsymutil");

                if (File.Exists(PatchedDsymutilLocation.FullName))
                {
                    DsymutilLocation = PatchedDsymutilLocation;
                }

                DirectoryReference AutoSdkDir;
                if (UEBuildPlatformSDK.TryGetHostPlatformAutoSDKDir(out AutoSdkDir))
                {
                    FileReference AutoSdkDsymutilLocation = FileReference.Combine(AutoSdkDir, "Mac", "LLVM", "bin", "dsymutil");
                    if (FileReference.Exists(AutoSdkDsymutilLocation))
                    {
                        DsymutilLocation = AutoSdkDsymutilLocation;
                    }
                }
            }

            // 10.0.1 has an issue with LTO builds where we need to limit the number of threads
            ExtraOptions = (bIsForLTOBuild && Major == 10 && Minor == 0 && Patch == 1) ? "-j 1" : "";
            return(DsymutilLocation.FullName);
        }