[cmake-developers] [CMake 0014572]: Xcode 4.6 gcc problems on Mac OS X 10.9
Mantis Bug Tracker
mantis at public.kitware.com
Sat Nov 16 18:24:53 EST 2013
The following issue has been SUBMITTED.
======================================================================
http://cmake.org/Bug/view.php?id=14572
======================================================================
Reported By: Clinton Stimpson
Assigned To:
======================================================================
Project: CMake
Issue ID: 14572
Category: CMake
Reproducibility: have not tried
Severity: minor
Priority: normal
Status: new
======================================================================
Date Submitted: 2013-11-16 18:24 EST
Last Modified: 2013-11-16 18:24 EST
======================================================================
Summary: Xcode 4.6 gcc problems on Mac OS X 10.9
Description:
CMake doesn't work well when trying to use gcc from Xcode 4.6 on Mac OS X 10.9.
I've installed Xcode 4.6 from the developer website.
Then did xcode-select /Applications/Xcode-4.6.app
Running
cmake -G Xcode
gives
CMake Warning at .../Modules/Platform/Darwin.cmake:179 (message):
Ignoring CMAKE_OSX_SYSROOT value:
/Applications/Xcode-4.6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
because the directory does not exist.
But, if I want to use the gcc compiler instead, by running:
cmake -G Xcode -T com.apple.compilers.llvmgcc42
it gives:
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler using: Xcode
-- Check for working C compiler using: Xcode -- broken
....
To help that, I set
export
SDKROOT=/Applications/Xcode-4.6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
then try again with a clean build dir to get:
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler using: Xcode
-- Check for working C compiler using: Xcode -- works
The compiler id test failed.
I go into CMakeFiles/<version>/CompilerIdC and run xcodebuild -project
CompierIdC.xcodeproj and it fails to link because of this error:
ld: library not found for -lcrt1.10.6.o
If the xcodeproj is manually edited to include
SDKROOT =
"/Applications/Xcode-4.6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk";
Then the problem goes away.
Using the Makefile generator didn't have these issues.
I could set the environment variables CC, CXX, SDKROOT and things worked fine.
CMake knows how to avoid the linker error about not finding -lcrt1.10.6.o when
using the Makefile generator by using -sysroot on the compiler id test. The
xcode generator needs the same.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2013-11-16 18:24 Clinton StimpsonNew Issue
======================================================================
More information about the cmake-developers
mailing list