summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Darwin-GNU.cmake
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2010-01-29 16:56:35 (GMT)
committerDavid Cole <david.cole@kitware.com>2010-01-29 16:56:35 (GMT)
commit6ee87b2e5cd31b256c9f1d2f43bd24e665469732 (patch)
tree1383f9961df27fc160e1f0634f6faf96a90dbfc8 /Modules/Platform/Darwin-GNU.cmake
parent42c3eb85d62012bad8df85047df70b8fd9bbbeab (diff)
downloadCMake-6ee87b2e5cd31b256c9f1d2f43bd24e665469732.zip
CMake-6ee87b2e5cd31b256c9f1d2f43bd24e665469732.tar.gz
CMake-6ee87b2e5cd31b256c9f1d2f43bd24e665469732.tar.bz2
Fix issue #10155 - 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.
Diffstat (limited to 'Modules/Platform/Darwin-GNU.cmake')
-rw-r--r--Modules/Platform/Darwin-GNU.cmake20
1 files changed, 20 insertions, 0 deletions
diff --git a/Modules/Platform/Darwin-GNU.cmake b/Modules/Platform/Darwin-GNU.cmake
index b528c88..4c2194a 100644
--- a/Modules/Platform/Darwin-GNU.cmake
+++ b/Modules/Platform/Darwin-GNU.cmake
@@ -42,3 +42,23 @@ macro(cmake_gnu_has_isysroot lang)
endif()
endif()
endmacro()
+
+macro(cmake_gnu_set_osx_deployment_target_flag lang)
+ if(NOT DEFINED CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG)
+ set(_doc "${lang} compiler supports OSX deployment target flag")
+ message(STATUS "Checking whether ${_doc}")
+ execute_process(
+ COMMAND ${CMAKE_${lang}_COMPILER} "-v" "--help"
+ OUTPUT_VARIABLE _gcc_help
+ ERROR_VARIABLE _gcc_help
+ )
+ if("${_gcc_help}" MATCHES "macosx-version-min")
+ message(STATUS "Checking whether ${_doc} - yes")
+ set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mmacosx-version-min=")
+ else()
+ message(STATUS "Checking whether ${_doc} - no")
+ set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "")
+ endif()
+ set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG_CODE "SET(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG \"${CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG}\")")
+ endif()
+endmacro()