diff options
author | Brad King <brad.king@kitware.com> | 2012-09-21 12:53:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-09-21 12:53:42 (GMT) |
commit | a0a0877a1eb111d37ac4766a368206e73458489e (patch) | |
tree | df5ed0dc179b7391972576c1c21ed70d87efbf22 /Modules/Platform/Darwin-GNU.cmake | |
parent | 33a60e6bd148479c63734286417f582444bf36b6 (diff) | |
download | CMake-a0a0877a1eb111d37ac4766a368206e73458489e.zip CMake-a0a0877a1eb111d37ac4766a368206e73458489e.tar.gz CMake-a0a0877a1eb111d37ac4766a368206e73458489e.tar.bz2 |
OS X: Always generate -isysroot if any SDK is in use
Drop the last use of CMAKE_OSX_SYSROOT_DEFAULT. Replace internal
platform variable CMAKE_${lang}_HAS_ISYSROOT with a more general
CMAKE_${lang}_SYSROOT_FLAG variable. If the -isysroot flag exists and
CMAKE_OSX_SYSROOT points to an SDK (not "/") then always add it to
compiler command lines. This is already done in the Xcode IDE.
Diffstat (limited to 'Modules/Platform/Darwin-GNU.cmake')
-rw-r--r-- | Modules/Platform/Darwin-GNU.cmake | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/Platform/Darwin-GNU.cmake b/Modules/Platform/Darwin-GNU.cmake index 5e9f8f0..d953503 100644 --- a/Modules/Platform/Darwin-GNU.cmake +++ b/Modules/Platform/Darwin-GNU.cmake @@ -24,8 +24,8 @@ macro(__darwin_compiler_gnu lang) set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "-bundle -Wl,-headerpad_max_install_names") endmacro() -macro(cmake_gnu_has_isysroot lang) - if("x${CMAKE_${lang}_HAS_ISYSROOT}" STREQUAL "x") +macro(cmake_gnu_set_sysroot_flag lang) + if(NOT DEFINED CMAKE_${lang}_SYSROOT_FLAG) set(_doc "${lang} compiler has -isysroot") message(STATUS "Checking whether ${_doc}") execute_process( @@ -35,11 +35,12 @@ macro(cmake_gnu_has_isysroot lang) ) if("${_gcc_help}" MATCHES "isysroot") message(STATUS "Checking whether ${_doc} - yes") - set(CMAKE_${lang}_HAS_ISYSROOT 1) + set(CMAKE_${lang}_SYSROOT_FLAG "-isysroot") else() message(STATUS "Checking whether ${_doc} - no") - set(CMAKE_${lang}_HAS_ISYSROOT 0) + set(CMAKE_${lang}_SYSROOT_FLAG "") endif() + set(CMAKE_${lang}_SYSROOT_FLAG_CODE "set(CMAKE_${lang}_SYSROOT_FLAG \"${CMAKE_${lang}_SYSROOT_FLAG}\")") endif() endmacro() |