[cmake-developers] -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="" -DCMAKE_OSX_SYSROOT:STRING=/ broken in 3.7.0-rc2

Jack Howarth howarth.mailing.lists at gmail.com
Sun Oct 30 09:36:56 EDT 2016


The change...

--- cmake-3.6.2/Modules/Platform/Darwin-Initialize.cmake 2016-09-07
10:11:58.000000000 -0400
+++ cmake-3.7.0-rc2/Modules/Platform/Darwin-Initialize.cmake
2016-10-19 09:47:45.000000000 -0400
@@ -125,8 +125,10 @@
       set(_CMAKE_OSX_SYSROOT_ORIG "")
     endif()
     set(_CMAKE_OSX_SYSROOT_PATH "${CMAKE_OSX_SYSROOT}")
-  else()
-    # Transform the sdk name into a path.
+  endif()
+
+  if(CMAKE_OSX_SYSROOT)
+    # Transform the (maybe unversioned) sysroot into a versioned path.
     execute_process(
       COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version Path
       OUTPUT_VARIABLE _stdout

is an obvious mistake in cmake 3.7.0-rc2. The removal of the 'else()'
statement here and the substitution of the ' if(CMAKE_OSX_SYSROOT)'
defeats the prior handling of 'if("x${CMAKE_OSX_SYSROOT}" MATCHES
"/")'. This causes '-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=""
-DCMAKE_OSX_SYSROOT:STRING=/' to not be honored and -isysroot to be
emitted as a compiler flag universally.

https://gitlab.kitware.com/cmake/cmake/issues/16394


More information about the cmake-developers mailing list