在将mac os升级为mavericks之后,我的项目不再使用新的编译器进行编译(一个clang 5.1 ......)。
所以我按照此链接中的说明安装了旧的gcc 4.2。
https://coderwall.com/p/lqpp8w
然后我修改了符号链接cc和c ++以指向我刚刚安装的gcc
当我运行cmake时,它现在确实找到了gcc 4.2而不是clang 5.1的编译器。但是它仍然想要使用新xcode中的包含:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1/
而不是编译器的那些:
/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/include/gcc/darwin/4.2/
这是我的cmake的输出
-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is GNU 4.2.1
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
并且在CMakeCache.txt上我有以下
CMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/
我怎样才能摆脱那些糟糕的包含?
感谢。