Skip to content

Commit

Permalink
Merge branch 'saudi/fix-compiler-options-order-xcode' into 'main'
Browse files Browse the repository at this point in the history
Fix compiler/linker compiler options order in xcode projects

See merge request Sharpmake/sharpmake!553
  • Loading branch information
jspelletier committed Sep 12, 2024
2 parents c7f5bb5 + 5680824 commit 675e07e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sharpmake.Generators/Apple/XCodeProj.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,7 @@ private Options.ExplicitOptions GenerateOptions(XCodeGenerationContext context)
libFiles.AddRange(conf.DependenciesOtherLibraryFiles);
libFiles.Sort();

conf.AdditionalLinkerOptions.Sort();
var linkerOptions = new Strings(conf.AdditionalLinkerOptions);

var linkObjC = Options.GetObject<Options.XCode.Linker.LinkObjC>(conf);
Expand Down Expand Up @@ -1542,6 +1543,8 @@ private Options.ExplicitOptions GenerateOptions(XCodeGenerationContext context)
conf.Defines.Add("NDEBUG");

options["PreprocessorDefinitions"] = XCodeUtil.XCodeFormatList(conf.Defines, 4, forceQuotes: true);
conf.AdditionalCompilerOptions.Sort();
conf.AdditionalCompilerOptimizeOptions.Sort();
options["CompilerOptions"] = XCodeUtil.XCodeFormatList(Enumerable.Concat(conf.AdditionalCompilerOptions, conf.AdditionalCompilerOptimizeOptions), 4, forceQuotes: true);
if (conf.AdditionalLibrarianOptions.Any())
throw new NotImplementedException(nameof(conf.AdditionalLibrarianOptions) + " not supported with XCode generator");
Expand Down

0 comments on commit 675e07e

Please sign in to comment.