I have a Jenkins build server running macOS 10.12.
I am compiling a C++ application using the latest Clang 10 (not AppleClang) with CMake 3.17.
The error I get is:
The C++ compiler
"/Users/XXX/llvm/bin/clang++"
is not able to compile a simple test program.
It fails with the following output:
ld: unknown option: -platform_version
clang-10: error: linker failed with exit code 1
This works fine with Clang 9 on the same server and Clang 10 works fine on macOS 10.15 with all other build tools and source files the same (Jenkins runs a clean build each time). It seems to be the combination of Clang 10 and macOS 10.12. Has anything changed between Clang 9 and Clang 10 that would cause this?
I'm invoking CMake like so:
cmake -DCMAKE_OSX_SYSROOT="${macos_sdk}" \
-DCMAKE_C_COMPILER="${llvm_bin}/clang" \
-DCMAKE_CXX_COMPILER="${llvm_bin}/clang++" \
-DCMAKE_OSX_ARCHITECTURES=${architectures} \
-DCMAKE_BUILD_TYPE=${make_build_type} ..