summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeBackwardCompatibilityC.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/CMakeBackwardCompatibilityC.cmake')
-rw-r--r--Modules/CMakeBackwardCompatibilityC.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/Modules/CMakeBackwardCompatibilityC.cmake b/Modules/CMakeBackwardCompatibilityC.cmake
index b7014cf..c6537cf 100644
--- a/Modules/CMakeBackwardCompatibilityC.cmake
+++ b/Modules/CMakeBackwardCompatibilityC.cmake
@@ -23,6 +23,17 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
+ # Old CMake versions did not support OS X universal binaries anyway,
+ # so just get through this with at least some size for the types.
+ LIST(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHS)
+ IF(${NUM_ARCHS} GREATER 1)
+ IF(NOT DEFINED CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
+ MESSAGE(WARNING "This module does not work with OS X universal binaries.")
+ SET(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES 1)
+ LIST(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
+ ENDIF()
+ ENDIF()
+
INCLUDE (CheckTypeSize)
CHECK_TYPE_SIZE(int CMAKE_SIZEOF_INT)
CHECK_TYPE_SIZE(long CMAKE_SIZEOF_LONG)
@@ -70,6 +81,11 @@ IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
SET (CMAKE_USE_SPROC ${CMAKE_USE_SPROC_INIT} CACHE BOOL
"Use sproc libs.")
+
+ IF(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
+ SET(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
+ SET(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
+ ENDIF()
ENDIF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
MARK_AS_ADVANCED(