diff --git a/.ado/templates/fluentui-apple-publish-nuget-job.yml b/.ado/templates/fluentui-apple-publish-nuget-job.yml index f92285b45..4b2fe9d70 100644 --- a/.ado/templates/fluentui-apple-publish-nuget-job.yml +++ b/.ado/templates/fluentui-apple-publish-nuget-job.yml @@ -18,7 +18,7 @@ jobs: xcode_actions: 'build' xcode_scheme: 'FluentUI-macOS' xcode_configuration: 'Debug' - xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/publish_overrides.xcconfig' + xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/publish_overrides_macos.xcconfig' # macOS Framework Release - template: apple-xcode-build.yml @@ -28,7 +28,7 @@ jobs: xcode_actions: 'build' xcode_scheme: 'FluentUI-macOS' xcode_configuration: 'Release' - xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/publish_overrides.xcconfig' + xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/publish_overrides_macos.xcconfig' # iphonesimulator Library Debug - template: apple-xcode-build.yml @@ -38,7 +38,7 @@ jobs: xcode_actions: 'build' xcode_scheme: 'FluentUI-iOS-StaticLib' xcode_configuration: 'Debug' - xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/publish_overrides.xcconfig' + xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/publish_overrides_ios.xcconfig' # iphonesimulator Library Release - template: apple-xcode-build.yml @@ -48,7 +48,7 @@ jobs: xcode_actions: 'build' xcode_scheme: 'FluentUI-iOS-StaticLib' xcode_configuration: 'Release' - xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/publish_overrides.xcconfig' + xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/publish_overrides_ios.xcconfig' # iphoneos Library Debug - template: apple-xcode-build.yml @@ -58,7 +58,7 @@ jobs: xcode_actions: 'build' xcode_scheme: 'FluentUI-iOS-StaticLib' xcode_configuration: 'Debug' - xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/publish_overrides.xcconfig' + xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/publish_overrides_ios.xcconfig' # iphoneos Library Release - template: apple-xcode-build.yml @@ -68,7 +68,7 @@ jobs: xcode_actions: 'build' xcode_scheme: 'FluentUI-iOS-StaticLib' xcode_configuration: 'Release' - xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/publish_overrides.xcconfig' + xcode_extraArgs: '-xcconfig $(Build.Repository.LocalPath)/.ado/xcconfig/publish_overrides_ios.xcconfig' # Zip our build output. It's important to zip here to preserve symlinks - bash: 'scripts/prepare_for_nuget_pack.sh' diff --git a/.ado/xcconfig/publish_overrides.xcconfig b/.ado/xcconfig/publish_overrides.xcconfig index 1a7440610..c81e5875d 100644 --- a/.ado/xcconfig/publish_overrides.xcconfig +++ b/.ado/xcconfig/publish_overrides.xcconfig @@ -11,6 +11,3 @@ ONLY_ACTIVE_ARCH=NO // Build for distribution so that this is consumable from other versions of Xcode BUILD_LIBRARY_FOR_DISTRIBUTION=YES - -// Explicitly build arm64e for iOS device builds in case our clients need it -ARCHS = $(ARCHS_STANDARD) arm64e diff --git a/.ado/xcconfig/publish_overrides_ios.xcconfig b/.ado/xcconfig/publish_overrides_ios.xcconfig new file mode 100644 index 000000000..39d564b93 --- /dev/null +++ b/.ado/xcconfig/publish_overrides_ios.xcconfig @@ -0,0 +1,4 @@ +#include "publish_overrides.xcconfig" + +// Explicitly build arm64e for iOS device builds in case our clients need it +ARCHS = $(ARCHS_STANDARD) arm64e diff --git a/.ado/xcconfig/publish_overrides_macos.xcconfig b/.ado/xcconfig/publish_overrides_macos.xcconfig new file mode 100644 index 000000000..d690f6715 --- /dev/null +++ b/.ado/xcconfig/publish_overrides_macos.xcconfig @@ -0,0 +1,5 @@ +#include "publish_overrides.xcconfig" + +// opt into arm64 on macOS +// note: the arm64 arch is safely ignored on versions of Xcode where macOS doesn't support arm64 +ARCHS = $(ARCHS_STANDARD) arm64 diff --git a/scripts/nuget_publish.sh b/scripts/nuget_publish.sh index ca74124c8..b6d7cfd00 100755 --- a/scripts/nuget_publish.sh +++ b/scripts/nuget_publish.sh @@ -13,7 +13,9 @@ EXIT_CODE=0 XCODEBUILD_WRAPPER_LOCATION='scripts/xcodebuild_wrapper.sh' # Extra arguments for xcode build to mimic nuget publishing environment -XCODEBUILD_EXTRA_ARGS='-xcconfig .ado/xcconfig/publish_overrides.xcconfig -derivedDataPath DerivedData' +DERIVED_DATA_EXTRA_ARG='-derivedDataPath DerivedData' +IOS_XCCONFIG_EXTRA_ARG='-xcconfig .ado/xcconfig/publish_overrides_ios.xcconfig' +MACOS_XCCONFIG_EXTRA_ARG='-xcconfig .ado/xcconfig/publish_overrides_macos.xcconfig' function handle_exit_code() { @@ -26,27 +28,27 @@ function handle_exit_code() } echo "Building and Testing macOS Debug" -$XCODEBUILD_WRAPPER_LOCATION macos_build FluentUI-macOS Debug build $XCODEBUILD_EXTRA_ARGS +$XCODEBUILD_WRAPPER_LOCATION macos_build FluentUI-macOS Debug build $DERIVED_DATA_EXTRA_ARG $MACOS_XCCONFIG_EXTRA_ARG handle_exit_code echo "Building and Testing macOS Release" -$XCODEBUILD_WRAPPER_LOCATION macos_build FluentUI-macOS Release build $XCODEBUILD_EXTRA_ARGS +$XCODEBUILD_WRAPPER_LOCATION macos_build FluentUI-macOS Release build $DERIVED_DATA_EXTRA_ARG $MACOS_XCCONFIG_EXTRA_ARG handle_exit_code echo "Building iOS Static Lib Debug Simulator" -$XCODEBUILD_WRAPPER_LOCATION ios_simulator_build FluentUI-iOS-StaticLib Debug build $XCODEBUILD_EXTRA_ARGS +$XCODEBUILD_WRAPPER_LOCATION ios_simulator_build FluentUI-iOS-StaticLib Debug build $DERIVED_DATA_EXTRA_ARG $IOS_XCCONFIG_EXTRA_ARG handle_exit_code echo "Building iOS Static Lib Release Simulator" -$XCODEBUILD_WRAPPER_LOCATION ios_simulator_build FluentUI-iOS-StaticLib Release build $XCODEBUILD_EXTRA_ARGS +$XCODEBUILD_WRAPPER_LOCATION ios_simulator_build FluentUI-iOS-StaticLib Release build $DERIVED_DATA_EXTRA_ARG $IOS_XCCONFIG_EXTRA_ARG handle_exit_code echo "Building Static Lib iOS Debug Device" -$XCODEBUILD_WRAPPER_LOCATION ios_device_build FluentUI-iOS-StaticLib Debug build $XCODEBUILD_EXTRA_ARGS +$XCODEBUILD_WRAPPER_LOCATION ios_device_build FluentUI-iOS-StaticLib Debug build $DERIVED_DATA_EXTRA_ARG $IOS_XCCONFIG_EXTRA_ARG handle_exit_code echo "Building iOS Release Static Lib Device" -$XCODEBUILD_WRAPPER_LOCATION ios_device_build FluentUI-iOS-StaticLib Release build $XCODEBUILD_EXTRA_ARGS +$XCODEBUILD_WRAPPER_LOCATION ios_device_build FluentUI-iOS-StaticLib Release build $DERIVED_DATA_EXTRA_ARG $IOS_XCCONFIG_EXTRA_ARG handle_exit_code echo "Running scripts/prepare_for_nuget_pack.sh"