Apple Clang for Xcode 10.0 not supported with MACOSX_DEPLOYMENT_TARGET=10.7
CMake generates an error on first PROJECT()
with C++:
-- The C compiler identification is AppleClang 10.0.0.10001145
-- The CXX compiler identification is AppleClang 10.0.0.10001145
-- Check for working C compiler: /Applications/Xcode-10.0.app/Contents/Developer/usr/bin/gcc
-- Check for working C compiler: /Applications/Xcode-10.0.app/Contents/Developer/usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode-10.0.app/Contents/Developer/usr/bin/g++
-- Check for working CXX compiler: /Applications/Xcode-10.0.app/Contents/Developer/usr/bin/g++ -- broken
CMake Error at /usr/local/Cellar/cmake/3.12.2/share/cmake/Modules/CMakeTestCXXCompiler.cmake:45 (message):
The C++ compiler
"/Applications/Xcode-10.0.app/Contents/Developer/usr/bin/g++"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/travis/build/slodki/moneymanagerex/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_4e61e/fast"
/Applications/Xcode-10.0.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_4e61e.dir/build.make CMakeFiles/cmTC_4e61e.dir/build
Building CXX object CMakeFiles/cmTC_4e61e.dir/testCXXCompiler.cxx.o
/Applications/Xcode-10.0.app/Contents/Developer/usr/bin/g++ -isysroot /Applications/Xcode-10.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.7 -o CMakeFiles/cmTC_4e61e.dir/testCXXCompiler.cxx.o -c /Users/travis/build/slodki/moneymanagerex/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
1 warning generated.
Linking CXX executable cmTC_4e61e
/usr/local/Cellar/cmake/3.12.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4e61e.dir/link.txt --verbose=1
/Applications/Xcode-10.0.app/Contents/Developer/usr/bin/g++ -isysroot /Applications/Xcode-10.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.7 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_4e61e.dir/testCXXCompiler.cxx.o -o cmTC_4e61e
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [cmTC_4e61e] Error 1
make: *** [cmTC_4e61e/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:36 (PROJECT)
-- Configuring incomplete, errors occurred!
Is there any workaround to force stdlib param to compiler/linker before first PROJECT()
call?
Both combinations:
- Xcode 9.x and MACOSX_DEPLOYMENT_TARGET=10.7
- Xcode 10.0 and MACOSX_DEPLOYMENT_TARGET=10.9
works and only
- Xcode 10.0 and MACOSX_DEPLOYMENT_TARGET=10.7 is not working