summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2017-10-02 05:03:55 +0000
committerMichal Gorny <mgorny@gentoo.org>2017-10-02 05:03:55 +0000
commit63780036ddaf039747a5491d6dd7c2e3809bb41a (patch)
tree89d528cfe2e0fffc6f6b26f73d973ffdc954a8bd
parentc9b5e685aed2bf2bd2faa0566b90196f6e9eb7ba (diff)
[cmake] Add a separate CMake var to control profile runtime
Make it possible to control building profile runtime separately from other options. Before r313549, the profile runtime building was controlled along with sanitizers. However, since that commit it is built unconditionally which results in multiple builds for people building different runtimes separately. Differential Revision: https://reviews.llvm.org/D38441 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314646 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--CMakeLists.txt2
-rw-r--r--lib/CMakeLists.txt2
-rw-r--r--test/CMakeLists.txt4
3 files changed, 5 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c05403ebf..adb40f292 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,6 +38,8 @@ option(COMPILER_RT_BUILD_XRAY "Build xray" ON)
mark_as_advanced(COMPILER_RT_BUILD_XRAY)
option(COMPILER_RT_BUILD_LIBFUZZER "Build libFuzzer" ON)
mark_as_advanced(COMPILER_RT_BUILD_LIBFUZZER)
+option(COMPILER_RT_BUILD_PROFILE "Build profile runtime" ON)
+mark_as_advanced(COMPILER_RT_BUILD_PROFILE)
option(COMPILER_RT_BUILD_XRAY_NO_PREINIT "Build xray with no preinit patching" OFF)
mark_as_advanced(COMPILER_RT_BUILD_XRAY_NO_PREINIT)
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index a92d0a3f0..b3731f653 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -41,7 +41,7 @@ if(COMPILER_RT_BUILD_SANITIZERS)
endforeach()
endif()
-if (COMPILER_RT_HAS_PROFILE)
+if(COMPILER_RT_BUILD_PROFILE AND COMPILER_RT_HAS_PROFILE)
compiler_rt_build_runtime(profile)
endif()
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index e691eab7d..0acf87bc8 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -10,7 +10,7 @@ configure_lit_site_cfg(
set(SANITIZER_COMMON_LIT_TEST_DEPS)
-if (COMPILER_RT_HAS_PROFILE)
+if(COMPILER_RT_BUILD_PROFILE AND COMPILER_RT_HAS_PROFILE)
list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS profile)
endif()
@@ -72,7 +72,7 @@ if(COMPILER_RT_CAN_EXECUTE_TESTS)
endif()
endforeach()
endif()
- if (COMPILER_RT_HAS_PROFILE)
+ if(COMPILER_RT_BUILD_PROFILE AND COMPILER_RT_HAS_PROFILE)
compiler_rt_test_runtime(profile)
endif()
if(COMPILER_RT_BUILD_XRAY)