[compiler-rt] r276402 - [compiler-rt][cmake] Don't reset CAN_TARGET_${arch} on every cmake invocation.

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 03:15:09 PDT 2016


Author: dsanders
Date: Fri Jul 22 05:15:09 2016
New Revision: 276402

URL: http://llvm.org/viewvc/llvm-project?rev=276402&view=rev
Log:
[compiler-rt][cmake] Don't reset CAN_TARGET_${arch} on every cmake invocation.

Allowing this variable to be cached makes it possible to repair the MIPS
buildbots in lieu of either fixing the mips64 sanitizer issues or fixing the
detection of mips64 support (which I think was changed by r268977 but didn't
take effect on this buildbot until the last couple days) so that it returns to
not being built on these buildbots.


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

Modified: compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake?rev=276402&r1=276401&r2=276402&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/CompilerRTUtils.cmake Fri Jul 22 05:15:09 2016
@@ -113,16 +113,18 @@ macro(test_target_arch arch def)
     set(argstring "${argstring} ${arg}")
   endforeach()
   check_compile_definition("${def}" "${argstring}" HAS_${arch}_DEF)
-  if(NOT HAS_${arch}_DEF)
-    set(CAN_TARGET_${arch} FALSE)
-  elseif(TEST_COMPILE_ONLY)
-    try_compile_only(CAN_TARGET_${arch} ${TARGET_${arch}_CFLAGS})
-  else()
-    set(argstring "${CMAKE_EXE_LINKER_FLAGS} ${argstring}")
-    try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE}
-                COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS}"
-                OUTPUT_VARIABLE TARGET_${arch}_OUTPUT
-                CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${argstring}")
+  if(NOT DEFINED CAN_TARGET_${arch})
+    if(NOT HAS_${arch}_DEF)
+      set(CAN_TARGET_${arch} FALSE)
+    elseif(TEST_COMPILE_ONLY)
+      try_compile_only(CAN_TARGET_${arch} ${TARGET_${arch}_CFLAGS})
+    else()
+      set(argstring "${CMAKE_EXE_LINKER_FLAGS} ${argstring}")
+      try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE}
+                  COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS}"
+                  OUTPUT_VARIABLE TARGET_${arch}_OUTPUT
+                  CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${argstring}")
+    endif()
   endif()
   if(${CAN_TARGET_${arch}})
     list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch})




More information about the llvm-commits mailing list