diff options
author | Brad King <brad.king@kitware.com> | 2009-09-19 14:14:31 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-09-19 14:14:31 (GMT) |
commit | 180c60a86f5c44085a1a66865bfc8b9479c72e8a (patch) | |
tree | 33e7fc0647387c8a73a49e9a7e40c6d672fd5fee /Modules/Platform/Darwin.cmake | |
parent | 196d9a54aa7083c2d063147ac431c7efd11f393d (diff) | |
download | CMake-180c60a86f5c44085a1a66865bfc8b9479c72e8a.zip CMake-180c60a86f5c44085a1a66865bfc8b9479c72e8a.tar.gz CMake-180c60a86f5c44085a1a66865bfc8b9479c72e8a.tar.bz2 |
Fix check for -isysroot on OS X
Previously we checked for this flag by parsing the version number of GCC
out of 'gcc --version', but this is not reliable because the format can
vary greatly. Now we run 'gcc -v --help' and look for '-isysroot' in
the list of options.
We also now store the result on a per-language basis in the per-compiler
info file "CMake<LANG>Compiler.cmake". This is necessary to make it
accessible from try-compile projects so that they generate correctly.
Diffstat (limited to 'Modules/Platform/Darwin.cmake')
-rw-r--r-- | Modules/Platform/Darwin.cmake | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index fff091f..825f218 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -182,20 +182,6 @@ IF(XCODE) SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX) ENDIF(XCODE) -IF(NOT CMAKE_OSX_GCC_SUPPORT_ISYSROOT) - IF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") - EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} "--version" - OUTPUT_VARIABLE GCC_VERSION) - ENDIF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") - STRING(REGEX REPLACE "^[^ ]+[ ][^ ]+[ ]([^ ]+).*$" "\\1" - gcc_version_tmp "${GCC_VERSION}") - IF(${gcc_version_tmp} VERSION_GREATER 3.9) - SET(CMAKE_OSX_GCC_SUPPORT_ISYSROOT TRUE CACHE INTERNAL "GCC supports isysroot") - ELSE(${gcc_version_tmp} VERSION_GREATER 3.9) - SET(CMAKE_OSX_GCC_SUPPORT_ISYSROOT FALSE CACHE INTERNAL "GCC supports isysroot") - ENDIF(${gcc_version_tmp} VERSION_GREATER 3.9) -ENDIF(NOT CMAKE_OSX_GCC_SUPPORT_ISYSROOT) - # Need to list dependent shared libraries on link line. When building # with -isysroot (for universal binaries), the linker always looks for # dependent libraries under the sysroot. Listing them on the link |