Xcode 12.2 iOS Simulator arm64/x86_64 CompilerIdCXX failure [Apple Silicon]
I think the issue here is that CMake is not specifying the ARCH
because previously there was only one option x86_64
for iOS Simulators (ignoring i386
). In this case ARCH
should be set to arm64
.
Manually setting my toolchain back to Xcode 12.1.1 works and doesn't trigger this error, but it means that CMake might be broken for people running on Apple Silicon, or who need to make iOS Simulator builds compatible with Apple Silicon.
Using cmake version 3.19.0-rc3
The target system is: iOS - 9.0 - arm64
The host system is: Darwin - 19.6.0 - x86_64
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler:
Build flags:
Id flags:
The output was:
0
Command line invocation:
/Applications/Xcode-12.2.app/Contents/Developer/usr/bin/xcodebuild
note: Using new build system
note: Planning build
note: Constructing build description
warning: ONLY_ACTIVE_ARCH=YES requested with multiple ARCHS and no run destination to provide an active architecture; building for all applicable architectures (in target 'CompilerIdCXX' from project 'CompilerIdCXX')
warning: Traditional headermap style is no longer supported; please migrate to using separate headermaps and set 'ALWAYS_SEARCH_USER_PATHS' to NO. (in target 'CompilerIdCXX' from project 'CompilerIdCXX')
warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'CompilerIdCXX' from project 'CompilerIdCXX')
Invocation:
Executing: cmake -GXcode -DAPPLE_FRAMEWORK=ON -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release -DOPENCV_INCLUDE_INSTALL_PATH=include -DOPENCV_3P_LIB_INSTALL_PATH=lib/3rdparty -DFRAMEWORK_NAME=opencv2 -DBUILD_opencv_objc=OFF -DIOS_ARCH=arm64 -DCMAKE_TOOLCHAIN_FILE=/Users/chrisbal/Documents/opencv/platforms/ios/cmake/Toolchains/Toolchain-iPhoneSimulator_Xcode.cmake -DCMAKE_SYSTEM_PROCESSOR=arm64 -DCMAKE_OSX_ARCHITECTURES=arm64 -DCPU_BASELINE=DETECT -DCMAKE_CROSSCOMPILING=ON -DOPENCV_WORKAROUND_CMAKE_20989=ON /Users/chrisbal/Documents/opencv
-- Setting up iPhoneSimulator toolchain for IOS_ARCH='arm64'
-- iPhoneSimulator toolchain loaded
-- Setting up iPhoneSimulator toolchain for IOS_ARCH='arm64'
-- iPhoneSimulator toolchain loaded
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- The C compiler identification is AppleClang 12.0.0.12000032
CMake Error at CMakeLists.txt:109 (enable_language):
No CMAKE_CXX_COMPILER could be found.
CMake Error at CMakeLists.txt:109 (enable_language):
No CMAKE_C_COMPILER could be found.
-- Configuring incomplete, errors occurred!
See also "/Users/chrisbal/Documents/opencv/platforms/apple/xcframework-build/iphonesimulator-arm64/build/build-arm64-iphonesimulator/CMakeFiles/CMakeOutput.log".