summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compiler-rt/CMakeLists.txt3
-rw-r--r--compiler-rt/cmake/Modules/AddCompilerRT.cmake3
-rw-r--r--compiler-rt/cmake/Modules/SanitizerUtils.cmake1
3 files changed, 7 insertions, 0 deletions
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index 4a7be9c3851..123b60ea524 100644
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -15,6 +15,9 @@ include(LLVMParseArguments)
# runtime libraries.
cmake_minimum_required(VERSION 2.8.8)
+# Top level target used to build all compiler-rt libraries.
+add_custom_target(compiler-rt)
+
# Compute the Clang version from the LLVM version.
# FIXME: We should be able to reuse CLANG_VERSION variable calculated
# in Clang cmake files, instead of copying the rules here.
diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
index 021920c9eb0..def0c071ba0 100644
--- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -58,6 +58,7 @@ macro(add_compiler_rt_static_runtime name arch)
# Add installation command.
install(TARGETS ${name}
ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
+ add_dependencies(compiler-rt ${name})
else()
message(FATAL_ERROR "Archtecture ${arch} can't be targeted")
endif()
@@ -80,6 +81,7 @@ macro(add_compiler_rt_osx_static_runtime name)
ARCHIVE_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR})
install(TARGETS ${name}
ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
+ add_dependencies(compiler-rt ${name})
endmacro()
# Adds dynamic runtime library on osx, which supports multiple architectures.
@@ -100,6 +102,7 @@ macro(add_compiler_rt_osx_dynamic_runtime name)
LIBRARY_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR})
install(TARGETS ${name}
LIBRARY DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
+ add_dependencies(compiler-rt ${name})
endmacro()
# Unittests support.
diff --git a/compiler-rt/cmake/Modules/SanitizerUtils.cmake b/compiler-rt/cmake/Modules/SanitizerUtils.cmake
index aa7be300c0b..0836edee264 100644
--- a/compiler-rt/cmake/Modules/SanitizerUtils.cmake
+++ b/compiler-rt/cmake/Modules/SanitizerUtils.cmake
@@ -26,6 +26,7 @@ macro(add_sanitizer_rt_symbols name)
DEPENDS ${symsfile}
SOURCES ${SANITIZER_GEN_DYNAMIC_LIST} ${ARGN})
install(FILES ${symsfile} DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
+ add_dependencies(compiler-rt ${name}-symbols)
endmacro()
# Add target to check code style for sanitizer runtimes.
OpenPOWER on IntegriCloud