

One thing to watch out for is that the system CPU architecture doesn’t necessarily match the architectures that Xcode can compile for, since Xcode 12 running on x86_64 can cross-compile for arm64. (There’s also the arch command whose output might be easier to parse.) It seems to me that I am going to have to invoke some command line program (like sysctl -a | grep _string) via execute_process to determine the processor For example, here, I install the external project in the install subdirectory of the binary directory.

Using a custom install dir should fix the problem.
So any idea of how I can test for architecture support? TheCmake install mac code#
Ld: dynamic main executables must link with libSystem.dylib for architecture arm64Ĭlang: error: linker command failed with exit code 1 (use -v to see invocation) Ld: warning: ignoring file /Applications/Xcode11.3.1.app/Contents/Developer/Platforms/atform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd, missing required architecture arm64 in file /Applications/Xcode11.3.1.app/Contents/Developer/Platforms/atform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd Ld: warning: ignoring file /Applications/Xcode11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/lib/darwin/libclang_rt.osx.a, missing required architecture arm64 in file /Applications/Xcode11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/lib/darwin/libclang_rt.osx.a (3 slices) Applications/Xcode11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch x86_64 -arch arm64 -isysroot /Applications/Xcode11.3.1.app/Contents/Developer/Platforms/atform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_7d8db.dir/testCCompiler.c.o -o cmTC_7d8db Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7d8db.dir/link.txt -verbose=1

Applications/Xcode11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -arch x86_64 -arch arm64 -isysroot /Applications/Xcode11.3.1.app/Contents/Developer/Platforms/atform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14 -o CMakeFiles/cmTC_7d8db.dir/testCCompiler.c.o -c /Volumes/Vault/deployment/build/vst-sam-spl-64/Debug/CMakeFiles/CMakeTmp/testCCompiler.c Run Build Command(s):/usr/bin/make cmTC_7d8db/fast & /Applications/Xcode11.3.1.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_7d8db.dir/build.make CMakeFiles/cmTC_7d8db.dir/buildīuilding C object CMakeFiles/cmTC_7d8db.dir/testCCompiler.c.o Is not able to compile a simple test program.Ĭhange Dir: /Volumes/Vault/deployment/build/vst-sam-spl-64/Debug/CMakeFiles/CMakeTmp "/Applications/Xcode11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc" If I set CMAKE_OSX_ARCHITECTURES to x86_64 arm64 with XCode 11.3.1 (macos 10.14.6) I confirm that it just doesn’t work: CMake Error at /Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.17/Modules/CMakeTestCCompiler.cmake:60 (message):
