diff --git a/CMakeLists.txt b/CMakeLists.txt index 038a889c0f..9b8fc2d283 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,6 +181,18 @@ endif () # Architecture math(EXPR BITS "8*${CMAKE_SIZEOF_VOID_P}") add_definitions("-DTRI_BITS=${BITS}") + +include (TargetArch) +target_architecture(CMAKE_TARGET_ARCHITECTURES) +list(LENGTH CMAKE_TARGET_ARCHITECTURES cmake_target_arch_len) +if(NOT "${cmake_target_arch_len}" STREQUAL "1") + set(CMAKE_TARGET_ARCHITECTURE_UNIVERSAL TRUE) + set(CMAKE_TARGET_ARCHITECTURE_CODE "universal") +else() + set(CMAKE_TARGET_ARCHITECTURE_UNIVERSAL FALSE) + set(CMAKE_TARGET_ARCHITECTURE_CODE "${CMAKE_TARGET_ARCHITECTURES}") +endif() + include (VcMacros) include (OptimizeForArchitecture) OptimizeForArchitecture()