summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibarchive
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-11-23 16:30:58 (GMT)
committerBrad King <brad.king@kitware.com>2009-11-23 16:30:58 (GMT)
commit9e852190b337349840b1c4eca60f4f4e954d90f7 (patch)
treebcb4dbce81fdf92c62fee8677da5e510f9948b28 /Utilities/cmlibarchive
parent1da9b54a59a674cb59dad100658d5c14f5f95329 (diff)
downloadCMake-9e852190b337349840b1c4eca60f4f4e954d90f7.zip
CMake-9e852190b337349840b1c4eca60f4f4e954d90f7.tar.gz
CMake-9e852190b337349840b1c4eca60f4f4e954d90f7.tar.bz2
libarchive: Use one architecture for try-compiles
We use CHECK_TYPE_SIZE in libarchive to check for the existence of some types. For universal binary builds on the Mac, the size check can fail if it is inconsistent across architectures. However, we do not actually need the size so it is safe to do the checks for only one architecture. See issue #9913.
Diffstat (limited to 'Utilities/cmlibarchive')
-rw-r--r--Utilities/cmlibarchive/CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
index 4fbcbcf..982f968 100644
--- a/Utilities/cmlibarchive/CMakeLists.txt
+++ b/Utilities/cmlibarchive/CMakeLists.txt
@@ -4,6 +4,13 @@ PROJECT(libarchive C)
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.1)
SET(CMAKE_MODULE_PATH "${libarchive_SOURCE_DIR}/build/cmake")
+
+# We use CHECK_TYPE_SIZE for existence tests, so use only one arch.
+LIST(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHS)
+IF(${NUM_ARCHS} GREATER 1)
+ LIST(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
+ENDIF()
+
#
# Version - read from 'version' file.
#