From 9e852190b337349840b1c4eca60f4f4e954d90f7 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 23 Nov 2009 11:30:58 -0500 Subject: 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. --- Utilities/cmlibarchive/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Utilities') diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt index 4fbcbcfb58..982f968ee2 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. # -- cgit v1.2.1