[PATCH] Don't build tests for compiler-rt libs that aren't supported

Reid Kleckner rnk at google.com
Tue Jul 29 11:25:35 PDT 2014


Hi samsonov,

This silences lots of CMake warnings about adding dependencies on
non-existing targets.

http://reviews.llvm.org/D4709

Files:
  lib/CMakeLists.txt

Index: lib/CMakeLists.txt
===================================================================
--- lib/CMakeLists.txt
+++ lib/CMakeLists.txt
@@ -19,20 +19,33 @@
     add_subdirectory(asan)
     add_subdirectory(interception)
     add_subdirectory(sanitizer_common)
+  else()
+    # If we don't support the OS, clear the arch list to disable the tests.
+    set(ASAN_SUPPORTED_ARCH PARENT_SCOPE)
   endif()
   if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux|FreeBSD" AND NOT ANDROID)
     # LSan, UBsan and profile can be built on Mac OS, FreeBSD and Linux.
     add_subdirectory(lsan)
     add_subdirectory(profile)
     add_subdirectory(ubsan)
+  else()
+    # If we don't support the OS, clear the arch list to disable the tests.
+    set(LSAN_SUPPORTED_ARCH PARENT_SCOPE)
+    set(PROFILE_SUPPORTED_ARCH PARENT_SCOPE)
+    set(UBSAN_SUPPORTED_ARCH PARENT_SCOPE)
   endif()
   if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT ANDROID)
     # ThreadSanitizer and MemorySanitizer are supported on Linux only.
     add_subdirectory(tsan)
     add_subdirectory(tsan/dd)
     add_subdirectory(msan)
     add_subdirectory(msandr)
     add_subdirectory(dfsan)
+  else()
+    # If we don't support the OS, clear the arch list to disable the tests.
+    set(TSAN_SUPPORTED_ARCH PARENT_SCOPE)
+    set(DFSAN_SUPPORTED_ARCH PARENT_SCOPE)
+    set(MSAN_SUPPORTED_ARCH PARENT_SCOPE)
   endif()
 endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4709.11989.patch
Type: text/x-patch
Size: 1384 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140729/fb033484/attachment.bin>


More information about the llvm-commits mailing list