From 291723353aded650b030d92a5acfc771c564a6b7 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Thu, 1 Oct 2015 18:58:59 +0000 Subject: [PATCH] [CMake] Only add an OS to the supported OS lists if there are supported architectures for that OS. llvm-svn: 249054 --- compiler-rt/cmake/config-ix.cmake | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake index f07b10016b8a..b1d564d562d5 100644 --- a/compiler-rt/cmake/config-ix.cmake +++ b/compiler-rt/cmake/config-ix.cmake @@ -348,10 +348,13 @@ if(APPLE) set(DARWIN_10.4_BUILTIN_MIN_VER_FLAG -mmacosx-version-min=${DARWIN_10.4_BUILTIN_MIN_VER}) set(DARWIN_10.4_SKIP_CC_KEXT On) - list(APPEND BUILTIN_SUPPORTED_OS 10.4) darwin_test_archs(10.4 DARWIN_10.4_ARCHS ${toolchain_arches}) + message(STATUS "OSX 10.4 supported arches: ${DARWIN_10.4_ARCHS}") + if(DARWIN_10.4_ARCHES) + list(APPEND BUILTIN_SUPPORTED_OS 10.4) + endif() if(DARWIN_iossim_SYSROOT) set(DARWIN_iossim_CFLAGS @@ -366,13 +369,15 @@ if(APPLE) set(DARWIN_iossim_BUILTIN_MIN_VER_FLAG -mios-simulator-version-min=${DARWIN_iossim_BUILTIN_MIN_VER}) - list(APPEND SANITIZER_COMMON_SUPPORTED_OS iossim) - list(APPEND BUILTIN_SUPPORTED_OS iossim) set(DARWIN_iossim_SKIP_CC_KEXT On) darwin_test_archs(iossim DARWIN_iossim_ARCHS ${toolchain_arches}) message(STATUS "iOS Simulator supported arches: ${DARWIN_iossim_ARCHS}") + if(DARWIN_iossim_ARCHS) + list(APPEND SANITIZER_COMMON_SUPPORTED_OS iossim) + list(APPEND BUILTIN_SUPPORTED_OS iossim) + endif() foreach(arch ${DARWIN_iossim_ARCHS}) list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) set(CAN_TARGET_${arch} 1) @@ -392,13 +397,15 @@ if(APPLE) set(DARWIN_ios_BUILTIN_MIN_VER_FLAG -miphoneos-version-min=${DARWIN_ios_BUILTIN_MIN_VER}) - list(APPEND SANITIZER_COMMON_SUPPORTED_OS ios) - list(APPEND BUILTIN_SUPPORTED_OS ios) - list(APPEND PROFILE_SUPPORTED_OS ios) darwin_test_archs(ios DARWIN_ios_ARCHS ${toolchain_arches}) message(STATUS "iOS supported arches: ${DARWIN_ios_ARCHS}") + if(DARWIN_ios_ARCHS) + list(APPEND SANITIZER_COMMON_SUPPORTED_OS ios) + list(APPEND BUILTIN_SUPPORTED_OS ios) + list(APPEND PROFILE_SUPPORTED_OS ios) + endif() foreach(arch ${DARWIN_ios_ARCHS}) list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) set(CAN_TARGET_${arch} 1)