[compiler-rt] r240120 - CMake: Stop using LLVM's custom parse_arguments. NFC

Filipe Cabecinhas me at filcab.net
Thu Jun 18 20:39:25 PDT 2015


Author: filcab
Date: Thu Jun 18 22:39:24 2015
New Revision: 240120

URL: http://llvm.org/viewvc/llvm-project?rev=240120&view=rev
Log:
CMake: Stop using LLVM's custom parse_arguments. NFC

Summary:
Use CMake's cmake_parse_arguments() instead.
It's called in a slightly different way, but supports all our use cases.
It's in CMake 2.8.8, which is our minimum supported version.

CMake 3.0 doc (roughly the same. No direct link to 2.8.8 doc):
http://www.cmake.org/cmake/help/v3.0/module/CMakeParseArguments.html?highlight=cmake_parse_arguments

Since I was already changing these calls, I changed ARCH and LIB into
ARCHS and LIBS to make it more clear that they're lists of arguments.

Reviewers: eugenis, samsonov, beanz

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D10529

Modified:
    compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
    compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake
    compiler-rt/trunk/cmake/Modules/CompilerRTLink.cmake
    compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake
    compiler-rt/trunk/lib/asan/CMakeLists.txt
    compiler-rt/trunk/lib/asan/tests/CMakeLists.txt
    compiler-rt/trunk/lib/interception/CMakeLists.txt
    compiler-rt/trunk/lib/lsan/CMakeLists.txt
    compiler-rt/trunk/lib/msan/tests/CMakeLists.txt
    compiler-rt/trunk/lib/profile/CMakeLists.txt
    compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt
    compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt
    compiler-rt/trunk/lib/tsan/tests/CMakeLists.txt
    compiler-rt/trunk/lib/ubsan/CMakeLists.txt

Modified: compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake?rev=240120&r1=240119&r2=240120&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake Thu Jun 18 22:39:24 2015
@@ -1,19 +1,18 @@
 include(AddLLVM)
 include(ExternalProject)
-include(LLVMParseArguments)
 include(CompilerRTUtils)
 
 # Tries to add an "object library" target for a given list of OSs and/or
 # architectures with name "<name>.<arch>" for non-Darwin platforms if
 # architecture can be targeted, and "<name>.<os>" for Darwin platforms.
 # add_compiler_rt_object_libraries(<name>
-#                                  OS <os>
-#                                  ARCH <arch>
+#                                  OS <os names>
+#                                  ARCHS <architectures>
 #                                  SOURCES <source files>
 #                                  CFLAGS <compile flags>
 #                                  DEFS <compile definitions>)
 function(add_compiler_rt_object_libraries name)
-  parse_arguments(LIB "OS;ARCH;SOURCES;CFLAGS;DEFS" "" ${ARGN})
+  cmake_parse_arguments(LIB "" "" "OS;ARCHS;SOURCES;CFLAGS;DEFS" ${ARGN})
   set(libnames)
   if(APPLE)
     foreach(os ${LIB_OS})
@@ -22,7 +21,7 @@ function(add_compiler_rt_object_librarie
       set(extra_cflags_${libname} ${DARWIN_${os}_CFLAGS})
     endforeach()
   else()
-    foreach(arch ${LIB_ARCH})
+    foreach(arch ${LIB_ARCHS})
       set(libname "${name}.${arch}")
       set(libnames ${libnames} ${libname})
       set(extra_cflags_${libname} ${TARGET_${arch}_CFLAGS})
@@ -40,7 +39,7 @@ function(add_compiler_rt_object_librarie
     set_property(TARGET ${libname} APPEND PROPERTY
       COMPILE_DEFINITIONS ${LIB_DEFS})
     if(APPLE)
-      set_target_properties(${libname} PROPERTIES OSX_ARCHITECTURES "${LIB_ARCH}")
+      set_target_properties(${libname} PROPERTIES OSX_ARCHITECTURES "${LIB_ARCHS}")
     endif()
   endforeach()
 endfunction()
@@ -54,7 +53,7 @@ endfunction()
 #                         OUTPUT_NAME <output library name>)
 macro(add_compiler_rt_runtime name arch type)
   if(CAN_TARGET_${arch})
-    parse_arguments(LIB "SOURCES;CFLAGS;LINKFLAGS;DEFS;OUTPUT_NAME" "" ${ARGN})
+    cmake_parse_arguments(LIB "" "OUTPUT_NAME" "SOURCES;CFLAGS;LINKFLAGS;DEFS" ${ARGN})
     add_library(${name} ${type} ${LIB_SOURCES})
     # Setup compile flags and definitions.
     set_target_compile_flags(${name}
@@ -87,18 +86,18 @@ endmacro()
 
 # Same as add_compiler_rt_runtime(... STATIC), but creates a universal library
 # for several architectures.
-# add_compiler_rt_osx_static_runtime(<name> ARCH <architectures>
+# add_compiler_rt_osx_static_runtime(<name> ARCHS <architectures>
 #                                    SOURCES <source files>
 #                                    CFLAGS <compile flags>
 #                                    DEFS <compile definitions>)
 macro(add_compiler_rt_osx_static_runtime name)
-  parse_arguments(LIB "ARCH;SOURCES;CFLAGS;DEFS" "" ${ARGN})
+  cmake_parse_arguments(LIB "" "" "ARCHS;SOURCES;CFLAGS;DEFS" ${ARGN})
   add_library(${name} STATIC ${LIB_SOURCES})
   set_target_compile_flags(${name} ${LIB_CFLAGS})
   set_property(TARGET ${name} APPEND PROPERTY
     COMPILE_DEFINITIONS ${LIB_DEFS})
   set_target_properties(${name} PROPERTIES
-    OSX_ARCHITECTURES "${LIB_ARCH}"
+    OSX_ARCHITECTURES "${LIB_ARCHS}"
     ARCHIVE_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR})
   install(TARGETS ${name}
     ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
@@ -107,20 +106,20 @@ endmacro()
 # Adds dynamic runtime library on osx/iossim, which supports multiple
 # architectures.
 # add_compiler_rt_darwin_dynamic_runtime(<name> <os>
-#                                        ARCH <architectures>
+#                                        ARCHS <architectures>
 #                                        SOURCES <source files>
 #                                        CFLAGS <compile flags>
 #                                        DEFS <compile definitions>
 #                                        LINKFLAGS <link flags>)
 macro(add_compiler_rt_darwin_dynamic_runtime name os)
-  parse_arguments(LIB "ARCH;SOURCES;CFLAGS;DEFS;LINKFLAGS" "" ${ARGN})
+  cmake_parse_arguments(LIB "" "" "ARCHS;SOURCES;CFLAGS;DEFS;LINKFLAGS" ${ARGN})
   add_library(${name} SHARED ${LIB_SOURCES})
   set_target_compile_flags(${name} ${LIB_CFLAGS} ${DARWIN_${os}_CFLAGS})
   set_target_link_flags(${name} ${LIB_LINKFLAGS} ${DARWIN_${os}_LINKFLAGS})
   set_property(TARGET ${name} APPEND PROPERTY
     COMPILE_DEFINITIONS ${LIB_DEFS})
   set_target_properties(${name} PROPERTIES
-    OSX_ARCHITECTURES "${LIB_ARCH}"
+    OSX_ARCHITECTURES "${LIB_ARCHS}"
     LIBRARY_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR})
   install(TARGETS ${name}
     LIBRARY DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
@@ -169,7 +168,7 @@ endif()
 #                      DEPS <deps (e.g. runtime libs)>
 #                      LINK_FLAGS <link flags>)
 macro(add_compiler_rt_test test_suite test_name)
-  parse_arguments(TEST "SUBDIR;OBJECTS;DEPS;LINK_FLAGS" "" ${ARGN})
+  cmake_parse_arguments(TEST "" "SUBDIR" "OBJECTS;DEPS;LINK_FLAGS" "" ${ARGN})
   if(TEST_SUBDIR)
     set(output_bin "${CMAKE_CURRENT_BINARY_DIR}/${TEST_SUBDIR}/${test_name}")
   else()
@@ -236,7 +235,7 @@ macro(add_custom_libcxx name prefix)
     message(FATAL_ERROR "libcxx not found!")
   endif()
 
-  parse_arguments(LIBCXX "DEPS;CFLAGS" "" ${ARGN})
+  cmake_parse_arguments(LIBCXX "" "" "DEPS;CFLAGS" ${ARGN})
   foreach(flag ${LIBCXX_CFLAGS})
     set(flagstr "${flagstr} ${flag}")
   endforeach()

Modified: compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake?rev=240120&r1=240119&r2=240120&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake Thu Jun 18 22:39:24 2015
@@ -1,5 +1,3 @@
-include(LLVMParseArguments)
-
 # On Windows, CMAKE_*_FLAGS are built for MSVC but we use the GCC clang.exe,
 # which uses completely different flags. Translate some common flag types, and
 # drop the rest.
@@ -32,7 +30,7 @@ endfunction()
 #               CFLAGS <list of compile flags>
 #               DEPS <list of dependencies>)
 macro(clang_compile object_file source)
-  parse_arguments(SOURCE "CFLAGS;DEPS" "" ${ARGN})
+  cmake_parse_arguments(SOURCE "" "" "CFLAGS;DEPS" ${ARGN})
   get_filename_component(source_rpath ${source} REALPATH)
   if(NOT COMPILER_RT_STANDALONE_BUILD)
     list(APPEND SOURCE_DEPS clang compiler-rt-headers)

Modified: compiler-rt/trunk/cmake/Modules/CompilerRTLink.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/CompilerRTLink.cmake?rev=240120&r1=240119&r2=240120&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/CompilerRTLink.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/CompilerRTLink.cmake Thu Jun 18 22:39:24 2015
@@ -1,12 +1,10 @@
-include(LLVMParseArguments)
-
 # Link a shared library with COMPILER_RT_TEST_COMPILER.
 # clang_link_shared(<output.so>
 #                   OBJECTS <list of input objects>
 #                   LINKFLAGS <list of link flags>
 #                   DEPS <list of dependencies>)
 macro(clang_link_shared so_file)
-  parse_arguments(SOURCE "OBJECTS;LINKFLAGS;DEPS" "" ${ARGN})
+  cmake_parse_arguments(SOURCE "" "" "OBJECTS;LINKFLAGS;DEPS" ${ARGN})
   if(NOT COMPILER_RT_STANDALONE_BUILD)
     list(APPEND SOURCE_DEPS clang)
   endif()

Modified: compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake?rev=240120&r1=240119&r2=240120&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/SanitizerUtils.cmake Thu Jun 18 22:39:24 2015
@@ -1,5 +1,3 @@
-include(LLVMParseArguments)
-
 set(SANITIZER_GEN_DYNAMIC_LIST
   ${COMPILER_RT_SOURCE_DIR}/lib/sanitizer_common/scripts/gen_dynamic_list.py)
 
@@ -50,19 +48,19 @@ endmacro()
 
 macro(add_sanitizer_rt_version_list name)
   set(vers ${CMAKE_CURRENT_BINARY_DIR}/${name}.vers)
-  parse_arguments(ARG "LIB;EXTRA" "" ${ARGN})
+  cmake_parse_arguments(ARG "" "" "LIBS;EXTRA" ${ARGN})
   set(args)
   foreach(arg ${ARG_EXTRA})
     list(APPEND args "--extra" ${arg})
   endforeach()
-  foreach(arg ${ARG_LIB})
+  foreach(arg ${ARG_LIBS})
     list(APPEND args "$<TARGET_FILE:${arg}>")
   endforeach()
   add_custom_command(OUTPUT ${vers}
     COMMAND ${PYTHON_EXECUTABLE}
       ${SANITIZER_GEN_DYNAMIC_LIST} --version-list ${args}
       > ${vers}
-    DEPENDS ${SANITIZER_GEN_DYNAMIC_LIST} ${ARG_EXTRA} ${ARG_LIB}
+    DEPENDS ${SANITIZER_GEN_DYNAMIC_LIST} ${ARG_EXTRA} ${ARG_LIBS}
     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
     COMMENT "Generating version list for ${name}"
     VERBATIM)

Modified: compiler-rt/trunk/lib/asan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/CMakeLists.txt?rev=240120&r1=240119&r2=240120&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/CMakeLists.txt Thu Jun 18 22:39:24 2015
@@ -77,32 +77,32 @@ append_list_if(ANDROID log ASAN_DYNAMIC_
 if(APPLE)
   add_compiler_rt_object_libraries(RTAsan
     OS ${SANITIZER_COMMON_SUPPORTED_OS}
-    ARCH ${ASAN_SUPPORTED_ARCH}
+    ARCHS ${ASAN_SUPPORTED_ARCH}
     SOURCES ${ASAN_SOURCES} ${ASAN_CXX_SOURCES}
     CFLAGS ${ASAN_DYNAMIC_CFLAGS}
     DEFS ${ASAN_DYNAMIC_DEFINITIONS})
 else()
   add_compiler_rt_object_libraries(RTAsan 
-    ARCH ${ASAN_SUPPORTED_ARCH}
+    ARCHS ${ASAN_SUPPORTED_ARCH}
     SOURCES ${ASAN_SOURCES} CFLAGS ${ASAN_CFLAGS}
     DEFS ${ASAN_COMMON_DEFINITIONS})
   add_compiler_rt_object_libraries(RTAsan_cxx 
-    ARCH ${ASAN_SUPPORTED_ARCH}
+    ARCHS ${ASAN_SUPPORTED_ARCH}
     SOURCES ${ASAN_CXX_SOURCES} CFLAGS ${ASAN_CFLAGS}
     DEFS ${ASAN_COMMON_DEFINITIONS})
   add_compiler_rt_object_libraries(RTAsan_preinit 
-    ARCH ${ASAN_SUPPORTED_ARCH}
+    ARCHS ${ASAN_SUPPORTED_ARCH}
     SOURCES ${ASAN_PREINIT_SOURCES} CFLAGS ${ASAN_CFLAGS}
     DEFS ${ASAN_COMMON_DEFINITIONS})
   add_compiler_rt_object_libraries(RTAsan_dynamic 
-    ARCH ${ASAN_SUPPORTED_ARCH}
+    ARCHS ${ASAN_SUPPORTED_ARCH}
     SOURCES ${ASAN_SOURCES} ${ASAN_CXX_SOURCES}
     CFLAGS ${ASAN_DYNAMIC_CFLAGS}
     DEFS ${ASAN_DYNAMIC_DEFINITIONS})
 
   file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.cc "")
   add_compiler_rt_object_libraries(RTAsan_dynamic_version_script_dummy
-    ARCH ${ASAN_SUPPORTED_ARCH}
+    ARCHS ${ASAN_SUPPORTED_ARCH}
     SOURCES ${CMAKE_CURRENT_BINARY_DIR}/dummy.cc
     CFLAGS ${ASAN_DYNAMIC_CFLAGS}
     DEFS ${ASAN_DYNAMIC_DEFINITIONS})
@@ -113,7 +113,7 @@ add_custom_target(asan)
 if(APPLE)
   foreach (os ${SANITIZER_COMMON_SUPPORTED_OS})
     add_compiler_rt_darwin_dynamic_runtime(clang_rt.asan_${os}_dynamic ${os}
-      ARCH ${ASAN_SUPPORTED_ARCH}
+      ARCHS ${ASAN_SUPPORTED_ARCH}
       SOURCES $<TARGET_OBJECTS:RTAsan.${os}>
               $<TARGET_OBJECTS:RTInterception.${os}>
               $<TARGET_OBJECTS:RTSanitizerCommon.${os}>
@@ -156,7 +156,7 @@ else()
 
     if (UNIX AND NOT ${arch} MATCHES "i386|i686")
       add_sanitizer_rt_version_list(clang_rt.asan-dynamic-${arch}
-                                    LIB clang_rt.asan-${arch} clang_rt.asan_cxx-${arch}
+                                    LIBS clang_rt.asan-${arch} clang_rt.asan_cxx-${arch}
                                     EXTRA asan.syms.extra)
       set(VERSION_SCRIPT_FLAG
            -Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/clang_rt.asan-dynamic-${arch}.vers)

Modified: compiler-rt/trunk/lib/asan/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/CMakeLists.txt?rev=240120&r1=240119&r2=240120&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/tests/CMakeLists.txt Thu Jun 18 22:39:24 2015
@@ -129,7 +129,7 @@ endmacro()
 # Link ASan unit test for a given architecture from a set
 # of objects in with given linker flags.
 macro(add_asan_test test_suite test_name arch kind)
-  parse_arguments(TEST "OBJECTS;LINKFLAGS;SUBDIR" "WITH_TEST_RUNTIME" ${ARGN})
+  cmake_parse_arguments(TEST "WITH_TEST_RUNTIME" "" "OBJECTS;LINKFLAGS;SUBDIR" ${ARGN})
   get_target_flags_for_arch(${arch} TARGET_LINK_FLAGS)
   set(TEST_DEPS ${TEST_OBJECTS})
   if(NOT COMPILER_RT_STANDALONE_BUILD)

Modified: compiler-rt/trunk/lib/interception/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/interception/CMakeLists.txt?rev=240120&r1=240119&r2=240120&view=diff
==============================================================================
--- compiler-rt/trunk/lib/interception/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/interception/CMakeLists.txt Thu Jun 18 22:39:24 2015
@@ -14,6 +14,6 @@ append_no_rtti_flag(INTERCEPTION_CFLAGS)
 
 add_compiler_rt_object_libraries(RTInterception
     OS ${SANITIZER_COMMON_SUPPORTED_OS}
-    ARCH ${SANITIZER_COMMON_SUPPORTED_ARCH}
+    ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH}
     SOURCES ${INTERCEPTION_SOURCES}
     CFLAGS ${INTERCEPTION_CFLAGS})

Modified: compiler-rt/trunk/lib/lsan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/CMakeLists.txt?rev=240120&r1=240119&r2=240120&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/lsan/CMakeLists.txt Thu Jun 18 22:39:24 2015
@@ -20,7 +20,7 @@ add_custom_target(lsan)
 
 add_compiler_rt_object_libraries(RTLSanCommon
     OS ${SANITIZER_COMMON_SUPPORTED_OS}
-    ARCH ${LSAN_COMMON_SUPPORTED_ARCH}
+    ARCHS ${LSAN_COMMON_SUPPORTED_ARCH}
     SOURCES ${LSAN_COMMON_SOURCES}
     CFLAGS ${LSAN_CFLAGS})
 

Modified: compiler-rt/trunk/lib/msan/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/tests/CMakeLists.txt?rev=240120&r1=240119&r2=240120&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/msan/tests/CMakeLists.txt Thu Jun 18 22:39:24 2015
@@ -71,7 +71,7 @@ macro(msan_compile obj_list source arch
 endmacro()
 
 macro(msan_link_shared so_list so_name arch kind)
-  parse_arguments(SOURCE "OBJECTS;LINKFLAGS;DEPS" "" ${ARGN})
+  cmake_parse_arguments(SOURCE "" "" "OBJECTS;LINKFLAGS;DEPS" ${ARGN})
   set(output_so "${CMAKE_CURRENT_BINARY_DIR}/${so_name}.${arch}${kind}.so")
   get_target_flags_for_arch(${arch} TARGET_LINKFLAGS)
   if(NOT COMPILER_RT_STANDALONE_BUILD)

Modified: compiler-rt/trunk/lib/profile/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/CMakeLists.txt?rev=240120&r1=240119&r2=240120&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/profile/CMakeLists.txt Thu Jun 18 22:39:24 2015
@@ -11,7 +11,7 @@ set(PROFILE_SOURCES
 
 if(APPLE)
   add_compiler_rt_osx_static_runtime(clang_rt.profile_osx
-    ARCH ${PROFILE_SUPPORTED_ARCH}
+    ARCHS ${PROFILE_SUPPORTED_ARCH}
     SOURCES ${PROFILE_SOURCES})
   add_dependencies(profile clang_rt.profile_osx)
 else()

Modified: compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt?rev=240120&r1=240119&r2=240120&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt Thu Jun 18 22:39:24 2015
@@ -131,7 +131,7 @@ if(APPLE)
 
   add_compiler_rt_object_libraries(RTSanitizerCommon
     OS ${SANITIZER_COMMON_SUPPORTED_OS}
-    ARCH ${SANITIZER_COMMON_SUPPORTED_ARCH}
+    ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH}
     SOURCES ${SANITIZER_SOURCES} ${SANITIZER_LIBCDEP_SOURCES}
     CFLAGS ${SANITIZER_CFLAGS}
     DEFS ${SANITIZER_COMMON_DEFINITIONS})
@@ -142,11 +142,11 @@ else()
   # Otherwise, build separate libraries for each target.
   
   add_compiler_rt_object_libraries(RTSanitizerCommon
-    ARCH ${SANITIZER_COMMON_SUPPORTED_ARCH}
+    ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH}
     SOURCES ${SANITIZER_SOURCES} CFLAGS ${SANITIZER_CFLAGS}
     DEFS ${SANITIZER_COMMON_DEFINITIONS})
   add_compiler_rt_object_libraries(RTSanitizerCommonLibc
-    ARCH ${SANITIZER_COMMON_SUPPORTED_ARCH}
+    ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH}
     SOURCES ${SANITIZER_LIBCDEP_SOURCES} CFLAGS ${SANITIZER_CFLAGS}
     DEFS ${SANITIZER_COMMON_DEFINITIONS})
   foreach(arch ${SANITIZER_COMMON_SUPPORTED_ARCH})

Modified: compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt?rev=240120&r1=240119&r2=240120&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/tsan/dd/CMakeLists.txt Thu Jun 18 22:39:24 2015
@@ -28,7 +28,7 @@ if(CAN_TARGET_x86_64 AND UNIX AND NOT AP
   add_dependencies(dd clang_rt.dd-${arch})
 
   add_compiler_rt_object_libraries(RTDD
-    ARCH ${arch}
+    ARCHS ${arch}
     SOURCES ${DD_SOURCES} CFLAGS ${DD_CFLAGS})
 
   add_compiler_rt_runtime(clang_rt.dyndd-${arch} ${arch} SHARED

Modified: compiler-rt/trunk/lib/tsan/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/tests/CMakeLists.txt?rev=240120&r1=240119&r2=240120&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/tsan/tests/CMakeLists.txt Thu Jun 18 22:39:24 2015
@@ -36,7 +36,7 @@ macro(add_tsan_unittest testname)
   # Build unit tests only for 64-bit Linux.
   if(UNIX AND NOT APPLE)
     foreach(arch ${TSAN_SUPPORTED_ARCH})
-      parse_arguments(TEST "SOURCES;HEADERS" "" ${ARGN})
+      cmake_parse_arguments(TEST "" "" "SOURCES;HEADERS" ${ARGN})
       set(TEST_OBJECTS)
       foreach(SOURCE ${TEST_SOURCES} ${COMPILER_RT_GTEST_SOURCE})
         tsan_compile(TEST_OBJECTS ${SOURCE} ${arch} ${TEST_HEADERS})

Modified: compiler-rt/trunk/lib/ubsan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/CMakeLists.txt?rev=240120&r1=240119&r2=240120&view=diff
==============================================================================
--- compiler-rt/trunk/lib/ubsan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/ubsan/CMakeLists.txt Thu Jun 18 22:39:24 2015
@@ -31,7 +31,7 @@ if(APPLE)
   # Common parts of UBSan runtime.
   add_compiler_rt_object_libraries(RTUbsan
     OS ${SANITIZER_COMMON_SUPPORTED_OS}
-    ARCH ${UBSAN_COMMON_SUPPORTED_ARCH}
+    ARCHS ${UBSAN_COMMON_SUPPORTED_ARCH}
     SOURCES ${UBSAN_SOURCES} ${UBSAN_CXX_SOURCES}
     CFLAGS ${UBSAN_CXXFLAGS})
 
@@ -39,12 +39,12 @@ if(APPLE)
     # Initializer of standalone UBSan runtime.
     add_compiler_rt_object_libraries(RTUbsan_standalone
       OS ${SANITIZER_COMMON_SUPPORTED_OS}
-      ARCH ${UBSAN_SUPPORTED_ARCH}
+      ARCHS ${UBSAN_SUPPORTED_ARCH}
       SOURCES ${UBSAN_STANDALONE_SOURCES}
       CFLAGS ${UBSAN_STANDALONE_CFLAGS})
     foreach(os ${SANITIZER_COMMON_SUPPORTED_OS})
       add_compiler_rt_darwin_dynamic_runtime(clang_rt.ubsan_${os}_dynamic ${os}
-        ARCH ${UBSAN_SUPPORTED_ARCH}
+        ARCHS ${UBSAN_SUPPORTED_ARCH}
         SOURCES $<TARGET_OBJECTS:RTUbsan.${os}>
                 $<TARGET_OBJECTS:RTUbsan_standalone.${os}>
                 $<TARGET_OBJECTS:RTSanitizerCommon.${os}>)
@@ -56,17 +56,17 @@ if(APPLE)
 else()
   # Common parts of UBSan runtime.
   add_compiler_rt_object_libraries(RTUbsan
-    ARCH ${UBSAN_COMMON_SUPPORTED_ARCH}
+    ARCHS ${UBSAN_COMMON_SUPPORTED_ARCH}
     SOURCES ${UBSAN_SOURCES} CFLAGS ${UBSAN_CFLAGS})
   # C++-specific parts of UBSan runtime. Requires a C++ ABI library.
   add_compiler_rt_object_libraries(RTUbsan_cxx
-    ARCH ${UBSAN_COMMON_SUPPORTED_ARCH}
+    ARCHS ${UBSAN_COMMON_SUPPORTED_ARCH}
     SOURCES ${UBSAN_CXX_SOURCES} CFLAGS ${UBSAN_CXXFLAGS})
 
   if(COMPILER_RT_HAS_UBSAN)
     # Initializer of standalone UBSan runtime.
     add_compiler_rt_object_libraries(RTUbsan_standalone
-      ARCH ${UBSAN_SUPPORTED_ARCH}
+      ARCHS ${UBSAN_SUPPORTED_ARCH}
       SOURCES ${UBSAN_STANDALONE_SOURCES} CFLAGS ${UBSAN_STANDALONE_CFLAGS})
     
     foreach(arch ${UBSAN_SUPPORTED_ARCH})





More information about the llvm-commits mailing list