summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeBackwardCompatibilityC.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-12-01 22:35:39 (GMT)
committerBrad King <brad.king@kitware.com>2009-12-01 22:35:39 (GMT)
commit27873a48d764900c2edfa76ca309f86d33b0f915 (patch)
tree571d0f8fab5f0b6d5bdcd303c9f69375e2ca19d8 /Modules/CMakeBackwardCompatibilityC.cmake
parentbbfcb198f8a0abd9f2382055ce4f55e8d4389549 (diff)
downloadCMake-27873a48d764900c2edfa76ca309f86d33b0f915.zip
CMake-27873a48d764900c2edfa76ca309f86d33b0f915.tar.gz
CMake-27873a48d764900c2edfa76ca309f86d33b0f915.tar.bz2
Use one arch for 1.4-compatible check_type_size
The CMakeBackwardCompatibilityC module provides some try-compile results that were automatically provided by CMake 1.4. When performing the checks for OS X universal binaries we just pick one architecture to get through the checks without error. Since CMake 1.4 did not support any universal binaries, projects that want them should not depend on this compatibility module anyway.
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(