[llvm-commits] [compiler-rt] r172978 - in /compiler-rt/trunk/lib: msan/CMakeLists.txt tsan/rtl/CMakeLists.txt

Alexey Samsonov samsonov at google.com
Sun Jan 20 06:14:13 PST 2013


Author: samsonov
Date: Sun Jan 20 08:14:13 2013
New Revision: 172978

URL: http://llvm.org/viewvc/llvm-project?rev=172978&view=rev
Log:
CMake: use add_compiler_rt_static_runtime to build TSan and MSan runtimes. No functionality change.

Modified:
    compiler-rt/trunk/lib/msan/CMakeLists.txt
    compiler-rt/trunk/lib/tsan/rtl/CMakeLists.txt

Modified: compiler-rt/trunk/lib/msan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/CMakeLists.txt?rev=172978&r1=172977&r2=172978&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/msan/CMakeLists.txt Sun Jan 20 08:14:13 2013
@@ -18,17 +18,15 @@
 
 # Static runtime library.
 set(MSAN_RUNTIME_LIBRARIES)
-add_library(clang_rt.msan-x86_64 STATIC
-  ${MSAN_RTL_SOURCES}
-  $<TARGET_OBJECTS:RTInterception.x86_64>
-  $<TARGET_OBJECTS:RTSanitizerCommon.x86_64>
-  )
-set_target_compile_flags(clang_rt.msan-x86_64
-  ${MSAN_RTL_CFLAGS} ${TARGET_x86_64_CFLAGS}
-  )
-list(APPEND MSAN_RUNTIME_LIBRARIES clang_rt.msan-x86_64)
-
-add_clang_compiler_rt_libraries(${MSAN_RUNTIME_LIBRARIES})
+set(arch "x86_64")
+if(CAN_TARGET_${arch})
+  add_compiler_rt_static_runtime(clang_rt.msan-${arch} ${arch}
+    SOURCES ${MSAN_RTL_SOURCES}
+            $<TARGET_OBJECTS:RTInterception.${arch}>
+            $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
+    CFLAGS ${MSAN_RTL_CFLAGS})
+  list(APPEND MSAN_RUNTIME_LIBRARIES clang_rt.msan-${arch})
+endif()
 
 if(LLVM_INCLUDE_TESTS)
   add_subdirectory(tests)

Modified: compiler-rt/trunk/lib/tsan/rtl/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/CMakeLists.txt?rev=172978&r1=172977&r2=172978&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/tsan/rtl/CMakeLists.txt Sun Jan 20 08:14:13 2013
@@ -37,22 +37,13 @@
   set(TSAN_ASM_SOURCES tsan_rtl_amd64.S)
   # Pass ASM file directly to the C++ compiler.
   set_source_files_properties(${TSAN_ASM_SOURCES} PROPERTIES
-    LANGUAGE C
-    )
-  add_library(clang_rt.tsan-x86_64 STATIC
-    ${TSAN_SOURCES}
-    ${TSAN_ASM_SOURCES}
-    $<TARGET_OBJECTS:RTInterception.x86_64>
-    $<TARGET_OBJECTS:RTSanitizerCommon.x86_64>
-    )
-  set_target_compile_flags(clang_rt.tsan-x86_64
-    ${TSAN_CFLAGS} ${TARGET_x86_64_CFLAGS}
-    )
-  list(APPEND TSAN_RUNTIME_LIBRARIES clang_rt.tsan-x86_64)
-endif()
-
-if(TSAN_RUNTIME_LIBRARIES)
-  set_property(TARGET ${TSAN_RUNTIME_LIBRARIES} APPEND PROPERTY
-    COMPILE_DEFINITIONS ${TSAN_COMMON_DEFINITIONS})
-  add_clang_compiler_rt_libraries(${TSAN_RUNTIME_LIBRARIES})
+    LANGUAGE C)
+  set(arch "x86_64")
+  add_compiler_rt_static_runtime(clang_rt.tsan-${arch} ${arch}
+    SOURCES ${TSAN_SOURCES} ${TSAN_ASM_SOURCES}
+            $<TARGET_OBJECTS:RTInterception.${arch}>
+            $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
+    CFLAGS ${TSAN_CFLAGS}
+    DEFS ${TSAN_COMMON_DEFINITIONS})
+  list(APPEND TSAN_RUNTIME_LIBRARIES clang_rt.tsan-${arch})
 endif()





More information about the llvm-commits mailing list