From 45c40fff662be282df01f8d04fc8186871802461 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 10 Nov 2015 17:26:40 +0000 Subject: [PATCH] [CMake] [macho_embedded] Only set sys root if the variable is set, this prevents passing empty -isysroot arguments This is a minor cleanup to the macho_embedded builtins. llvm-svn: 252619 --- compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake index 17195062235e..0edee653c4f3 100644 --- a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake +++ b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake @@ -161,8 +161,11 @@ macro(darwin_add_builtin_library name suffix) ${ARGN}) set(libname "${name}.${suffix}_${LIB_ARCH}_${LIB_OS}") add_library(${libname} STATIC ${LIB_SOURCES}) + if(DARWIN_${LIB_OS}_SYSROOT) + set(sysroot_flag -isysroot ${DARWIN_${LIB_OS}_SYSROOT}) + endif() set_target_compile_flags(${libname} - -isysroot ${DARWIN_${LIB_OS}_SYSROOT} + ${sysroot_flag} ${DARWIN_${LIB_OS}_BUILTIN_MIN_VER_FLAG} ${LIB_CFLAGS}) set_property(TARGET ${libname} APPEND PROPERTY @@ -409,6 +412,7 @@ macro(darwin_add_embedded_builtin_libraries) set(float_flag) if(${arch} MATCHES "^arm") set(DARWIN_macho_embedded_SYSROOT ${DARWIN_ios_SYSROOT}) + set(DARWIN_macho_embedded_BUILTIN_MIN_VER_FLAG ${DARWIN_ios_BUILTIN_MIN_VER_FLAG}) # x86 targets are hard float by default, but the complain about the # float ABI flag, so don't pass it unless we're targeting arm. set(float_flag ${${float_type}_FLOAT_FLAG})