Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/bolt
diff options
context:
space:
mode:
authorAmir Ayupov <aaupov@fb.com>2022-04-23 19:16:53 +0300
committerAmir Aupov <amir.aupov@gmail.com>2022-04-23 19:17:24 +0300
commit8634aa2503970499cd00390566a1cf6cf3cf6f7d (patch)
treeb413f2c37991031e437ecae4fff9fac4d2588af2 /bolt
parent38822b98fa3b9d740b9a68b0de34296205d20819 (diff)
[BOLT][CMAKE] Simplify Clang/LLD identification
Refactor nested conditions. NFC Reviewed By: maksfb Differential Revision: https://reviews.llvm.org/D123861
Diffstat (limited to 'bolt')
-rw-r--r--bolt/CMakeLists.txt41
1 files changed, 23 insertions, 18 deletions
diff --git a/bolt/CMakeLists.txt b/bolt/CMakeLists.txt
index cb4676f49bb4..5b09b51d60cb 100644
--- a/bolt/CMakeLists.txt
+++ b/bolt/CMakeLists.txt
@@ -16,26 +16,31 @@ architecture for use in BOLT tests")
set(BOLT_INCLUDE_TESTS OFF)
if (LLVM_INCLUDE_TESTS)
+ set(BOLT_CLANG_PRESENT OFF)
+ set(BOLT_LLD_PRESENT OFF)
+
+ if ("clang" IN_LIST LLVM_ENABLE_PROJECTS AND BOLT_CLANG_EXE)
+ message(WARNING "BOLT_CLANG_EXE is set and clang project is enabled. \
+ BOLT_CLANG_EXE will be used for BOLT tests.")
+ endif()
if ("clang" IN_LIST LLVM_ENABLE_PROJECTS OR BOLT_CLANG_EXE)
- if ("clang" IN_LIST LLVM_ENABLE_PROJECTS AND BOLT_CLANG_EXE)
- message(WARNING "BOLT_CLANG_EXE is set and clang project is enabled. \
- BOLT_CLANG_EXE will be used for BOLT tests.")
- endif()
- if ("lld" IN_LIST LLVM_ENABLE_PROJECTS OR BOLT_LLD_EXE)
- if ("lld" IN_LIST LLVM_ENABLE_PROJECTS AND BOLT_LLD_EXE)
- message(WARNING "BOLT_LLD_EXE is set and lld project is enabled. \
- BOLT_LLD_EXE will be used for BOLT tests.")
- endif()
- set(BOLT_INCLUDE_TESTS ON)
- else()
- message(WARNING "Not including BOLT tests since lld is disabled. \
- Enable lld in LLVM_ENABLE_PROJECTS or provide a path to lld binary \
- in BOLT_LLD_EXE.")
- endif()
+ set(BOLT_CLANG_PRESENT ON)
+ endif()
+
+ if ("lld" IN_LIST LLVM_ENABLE_PROJECTS AND BOLT_LLD_EXE)
+ message(WARNING "BOLT_LLD_EXE is set and lld project is enabled. \
+ BOLT_LLD_EXE will be used for BOLT tests.")
+ endif()
+ if ("lld" IN_LIST LLVM_ENABLE_PROJECTS OR BOLT_LLD_EXE)
+ set(BOLT_LLD_PRESENT ON)
+ endif()
+
+ if (BOLT_CLANG_PRESENT AND BOLT_LLD_PRESENT)
+ set(BOLT_INCLUDE_TESTS ON)
else()
- message(WARNING "Not including BOLT tests since clang is disabled. \
- Enable clang in LLVM_ENABLE_PROJECTS or provide a path to clang \
- binary in BOLT_CLANG_EXE.")
+ message(WARNING "Not including BOLT tests since clang or lld is disabled. \
+ Add clang and lld to LLVM_ENABLE_PROJECTS or provide paths to clang \
+ and lld binaries in BOLT_CLANG_EXE and BOLT_LLD_EXE.")
endif()
endif()