From 26e84017a3904bf88fa264f820f3f555aee67378 Mon Sep 17 00:00:00 2001 From: yhuang Date: Thu, 31 Aug 2023 16:19:03 -0500 Subject: [PATCH] support ObjC weak references for fastbuild --- .../Apple/BaseApplePlatform.Bff.Template.cs | 1 + .../Sharpmake.CommonPlatforms/Apple/BaseApplePlatform.cs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Apple/BaseApplePlatform.Bff.Template.cs b/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Apple/BaseApplePlatform.Bff.Template.cs index cda2ca568..6340724d0 100644 --- a/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Apple/BaseApplePlatform.Bff.Template.cs +++ b/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Apple/BaseApplePlatform.Bff.Template.cs @@ -45,6 +45,7 @@ public abstract partial class BaseApplePlatform + ' [cmdLineOptions.WarningReturnType]' + ' [cmdLineOptions.RuntimeTypeInfo]' + ' [cmdLineOptions.ClangEnableObjC_ARC]' + + ' [cmdLineOptions.ClangEnableObjC_Weak]' + ' [cmdLineOptions.CppExceptions]' + ' [cmdLineOptions.ObjCExceptions]' + ' [cmdLineOptions.ObjCARCExceptions]' diff --git a/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Apple/BaseApplePlatform.cs b/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Apple/BaseApplePlatform.cs index 04a817709..733cad30f 100644 --- a/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Apple/BaseApplePlatform.cs +++ b/Sharpmake.Platforms/Sharpmake.CommonPlatforms/Apple/BaseApplePlatform.cs @@ -703,8 +703,8 @@ public virtual void SelectCompilerOptions(IGenerationContext context) ); context.SelectOption( - Options.Option(Options.XCode.Compiler.ObjCWeakReferences.Disable, () => options["ObjCWeakReferences"] = "NO"), - Options.Option(Options.XCode.Compiler.ObjCWeakReferences.Enable, () => options["ObjCWeakReferences"] = "YES") + Options.Option(Options.XCode.Compiler.ObjCWeakReferences.Disable, () => { options["ObjCWeakReferences"] = "NO"; cmdLineOptions["ClangEnableObjC_Weak"] = FileGeneratorUtilities.RemoveLineTag; }), + Options.Option(Options.XCode.Compiler.ObjCWeakReferences.Enable, () => { options["ObjCWeakReferences"] = "YES"; cmdLineOptions["ClangEnableObjC_Weak"] = "-fobjc-weak"; }) ); context.SelectOption(