[PATCH] D23823: [builtins] Make sure builtin compile tests respect CMAKE_C_COMPILER_TARGET

Francis Ricci via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 25 09:23:53 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL279747: [builtins] Make sure builtin compile tests respect CMAKE_C_COMPILER_TARGET (authored by fjricci).

Changed prior to commit:
  https://reviews.llvm.org/D23823?vs=69179&id=69259#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D23823

Files:
  compiler-rt/trunk/cmake/Modules/BuiltinTests.cmake

Index: compiler-rt/trunk/cmake/Modules/BuiltinTests.cmake
===================================================================
--- compiler-rt/trunk/cmake/Modules/BuiltinTests.cmake
+++ compiler-rt/trunk/cmake/Modules/BuiltinTests.cmake
@@ -11,7 +11,13 @@
   file(WRITE ${SIMPLE_C} "${ARG_SOURCE}\n")
   string(REGEX MATCHALL "<[A-Za-z0-9_]*>" substitutions
          ${CMAKE_C_COMPILE_OBJECT})
-  string(REPLACE ";" " " extra_flags "${ARG_FLAGS}")
+
+  set(TRY_COMPILE_FLAGS "${ARG_FLAGS}")
+  if(CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_TARGET)
+    list(APPEND TRY_COMPILE_FLAGS "-target ${CMAKE_C_COMPILER_TARGET}")
+  endif()
+
+  string(REPLACE ";" " " extra_flags "${TRY_COMPILE_FLAGS}")
 
   set(test_compile_command "${CMAKE_C_COMPILE_OBJECT}")
   foreach(substitution ${substitutions})


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23823.69259.patch
Type: text/x-patch
Size: 809 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160825/5a7b63e5/attachment.bin>


More information about the llvm-commits mailing list