summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2009-09-18 18:22:20 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2009-09-18 18:22:20 (GMT)
commit58818d5168bb9b6402a1c3651a3a97173123e4ae (patch)
treed0bdaff63700dbeefea78811f5d2a681a3e2c0ad /Modules
parent3c32c904b33b3c16e2d050c10b217d6b7e327024 (diff)
downloadCMake-58818d5168bb9b6402a1c3651a3a97173123e4ae.zip
CMake-58818d5168bb9b6402a1c3651a3a97173123e4ae.tar.gz
CMake-58818d5168bb9b6402a1c3651a3a97173123e4ae.tar.bz2
Add detection of gcc versions that do not support isysroot option and do not use it for them.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Platform/Darwin.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index 825f218..fff091f 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -182,6 +182,20 @@ 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