MantisBT - CMake
View Issue Details
0010155CMakeCMakepublic2010-01-16 23:502010-12-14 18:50
vladsmail 
David Cole 
normalmajoralways
closedfixed 
CMake-2-8 
 
0010155: CMAKE_OSX_DEPLOYMENT_TARGET should be optional
The CMAKE_OSX_DEPLOYMENT_TARGET setting should either be optional or there should be a way to disable the -mmacosx-version-min= compiler flag. When building normal iPhone targets (arm architecture) this isn't a problem but if you try to make a iPhomeSimulator target (i386 x86_64) the -mmacosx-version-min clashes with the -miphoneos-version-min= flag:

Run Build Command:/usr/bin/make "cmTryCompileExec/fast"

  /usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  "/Applications/CMake 2.8-0.app/Contents/bin/cmake" -E cmake_progress_report
  /Users/queezy/Documents/CMakeOGL/builds/simulator-3.1/CMakeFiles/CMakeTmp/CMakeFiles
  1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o

  /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2
  -arch i386 -arch x86_64 -isysroot
  /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk
  -mmacosx-version-min=10.6 -isystem
  /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk/usr/include
  -isystem
  /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk/opt/iphone-simulator-3.1/include
  -isystem
  /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk/usr/local/iphone-simulator-3.1/include
  -std=c99 -arch i386 -arch x86_64 -pipe -no-cpp-precomp
  --sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk
  -miphoneos-version-min=3.1 -o
  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c
  /Users/queezy/Documents/CMakeOGL/builds/simulator-3.1/CMakeFiles/CMakeTmp/testCCompiler.c



  /Users/queezy/Documents/CMakeOGL/builds/simulator-3.1/CMakeFiles/CMakeTmp/testCCompiler.c:1:
  error: -mmacosx-version-min not allowed with -miphoneos-version-min


  /Users/queezy/Documents/CMakeOGL/builds/simulator-3.1/CMakeFiles/CMakeTmp/testCCompiler.c:1:
  error: -mmacosx-version-min not allowed with -miphoneos-version-min

  lipo: can't open input file: /var/tmp//ccgAZfkJ.out (No such file or
  directory)

  make[1]: *** [CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o] Error 1

  make: *** [cmTryCompileExec/fast] Error 2

The only way I have been able to disable this is by optionally unseting CMAKE_OSX_DEPLOYMENT_TARGET in Platform/Darwin.cmake. I don't really understand why the flag is hardcoded into Sources/cmLocalGenerator.cxx...
No tags attached.
related to 0009959closed David Cole new CMAKE_OSX_DEPLOYMENT_TARGET should set smarter if CMAKE_OSX_SYSROOT is defined 
Issue History
2010-01-16 23:50vladsmailNew Issue
2010-01-18 10:10Bill HoffmanStatusnew => assigned
2010-01-18 10:10Bill HoffmanAssigned To => David Cole
2010-01-29 11:34David ColeRelationship addedrelated to 0009959
2010-01-29 11:58David ColeNote Added: 0019366
2010-01-29 11:59David ColeNote Added: 0019367
2010-01-29 11:59David ColeStatusassigned => resolved
2010-01-29 11:59David ColeResolutionopen => fixed
2010-02-01 21:52David ColeStatusresolved => feedback
2010-02-01 21:52David ColeResolutionfixed => reopened
2010-02-01 21:52David ColeNote Added: 0019421
2010-02-01 21:52David ColeStatusfeedback => resolved
2010-02-01 21:52David ColeResolutionreopened => fixed
2010-12-14 18:50David ColeNote Added: 0024115
2010-12-14 18:50David ColeStatusresolved => closed

Notes
(0019366)
David Cole   
2010-01-29 11:58   
Fixed in CVS CMake.

cvs commit -m "Fix issue 0010155 - default value of CMAKE_OSX_DEPLOYMENT_TARGET should always be the empty string. When the value of CMAKE_OSX_DEPLOYMENT_TARGET is the empty string, the -mmacosx-version-min flag should not show up on the compiler command line. The logic for selecting default value of CMAKE_OSX_SYSROOT is orthogonal to and independent of the value of the deployment target. The default value for CMAKE_OSX_SYSROOT is the SDK that corresponds to the current version of Mac OSX on which cmake is running."

/cvsroot/CMake/CMake/Modules/CMakeCCompiler.cmake.in,v <-- Modules/CMakeCCompiler.cmake.in
new revision: 1.25; previous revision: 1.24
/cvsroot/CMake/CMake/Modules/CMakeCXXCompiler.cmake.in,v <-- Modules/CMakeCXXCompiler.cmake.in
new revision: 1.25; previous revision: 1.24
/cvsroot/CMake/CMake/Modules/Platform/Darwin-GNU-C.cmake,v <-- Modules/Platform/Darwin-GNU-C.cmake
new revision: 1.3; previous revision: 1.2
/cvsroot/CMake/CMake/Modules/Platform/Darwin-GNU-CXX.cmake,v <-- Modules/Platform/Darwin-GNU-CXX.cmake
new revision: 1.3; previous revision: 1.2
/cvsroot/CMake/CMake/Modules/Platform/Darwin-GNU.cmake,v <-- Modules/Platform/Darwin-GNU.cmake
new revision: 1.3; previous revision: 1.2
/cvsroot/CMake/CMake/Modules/Platform/Darwin.cmake,v <-- Modules/Platform/Darwin.cmake
new revision: 1.65; previous revision: 1.64
/cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v <-- Source/cmLocalGenerator.cxx
new revision: 1.323; previous revision: 1.322
(0019367)
David Cole   
2010-01-29 11:59   
Fixed in CVS HEAD of CMake. See previous note for commit details.
(0019421)
David Cole   
2010-02-01 21:52   
Style line length violation in last commit. This fixes it:

/cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v <-- Source/cmLocalGenerator.cxx
new revision: 1.324; previous revision: 1.323
(0024115)
David Cole   
2010-12-14 18:50   
Closing bugs that have been resolved for more than 3 months without any further updates.