From 0b9176874e90536c1de22963df427dea6056d172 Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Fri, 20 Aug 2021 22:51:00 +0200 Subject: [PATCH] Fix wxOSX build with Xcode 10 and later Update target architectures to support building with the whole range of supported Xcode versions by not targeting i386 by default, as well as adding an arm64 target. Targeting i386 results in a deprecation error starting with Xcode 10: error: The i386 architecture is deprecated. You should update your ARCHS build setting to remove the i386 architecture. --- build/osx/wxcocoa.xcconfig | 10 +++++++++- docs/changes.txt | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/build/osx/wxcocoa.xcconfig b/build/osx/wxcocoa.xcconfig index c238589daf..0aabf84400 100644 --- a/build/osx/wxcocoa.xcconfig +++ b/build/osx/wxcocoa.xcconfig @@ -4,9 +4,17 @@ WXTOOLKITUPPER = COCOA #include "wx.xcconfig" MACOSX_DEPLOYMENT_TARGET = 10.10 +MACOSX_DEPLOYMENT_TARGET[arch=arm64] = 11.0 GCC_VERSION = -ARCHS = i386 x86_64 +// Set ARCHS explicitly for when Xcode stops targeting x86_64 by default. +// Unknown targets are ignored by Xcode (arm64 requires Xcode 12 or later). +ARCHS = x86_64 arm64 + +// Using i386 as a target results in a deprecation error since Xcode 10 (first +// a warning in 9). If Xcode 9 or earlier is used and the i386 target is also +// needed, one solution is to enable the following line locally. +//ARCHS = i386 x86_64 OTHER_LDFLAGS = -framework WebKit -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework OpenGL -framework AVFoundation -framework CoreMedia -framework Security -framework QuartzCore -weak_framework AVKit diff --git a/docs/changes.txt b/docs/changes.txt index c089de2cd1..c6bba1ebd9 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -182,6 +182,10 @@ Changes in behaviour which may result in build errors - Under macOS, 10.11 SDK is the minimum SDK, building and deploying under 10.10.5 and higher is supported, you must use at least Xcode 7.2.1. +- wxOSX Xcode projects no longer include the i386 target by default and, + with Xcode 12 or later, build for the arm64 architecture in addition to + existing x86_64. See build/osx/wxcocoa.xcconfig for more information. + - wxPGProperty ctors are not longer public since this class is intended to be a base class and should not be instantiated directly.