[compiler-rt] r252619 - [CMake] [macho_embedded] Only set sys root if the variable is set, this prevents passing empty -isysroot arguments

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 10 09:26:40 PST 2015


Author: cbieneman
Date: Tue Nov 10 11:26:40 2015
New Revision: 252619

URL: http://llvm.org/viewvc/llvm-project?rev=252619&view=rev
Log:
[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.

Modified:
    compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake

Modified: compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake?rev=252619&r1=252618&r2=252619&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake Tue Nov 10 11:26:40 2015
@@ -161,8 +161,11 @@ macro(darwin_add_builtin_library name su
     ${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_librar
         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})




More information about the llvm-commits mailing list