summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Halkenhäuser <MichaelGerald.Halkenhauser@amd.com>2025-08-22 21:35:14 +0200
committerGitHub <noreply@github.com>2025-08-22 21:35:14 +0200
commit0810505e424b1df61bab799c338549a74d32b764 (patch)
tree068815994a860a31d912bb03c09ac4f0f6824cc3
parent0bbb79475432f72ee0e7d99cc5dc48bb8f8ff443 (diff)
[OpenMP][omptest] Skip omptest build if LLVM_INCLUDE_TESTS=OFF (#155020)
Add / expand early exit in CMakeLists.txt if LLVM_INCLUDE_TESTS is 'OFF'
-rw-r--r--openmp/tools/omptest/CMakeLists.txt11
1 files changed, 3 insertions, 8 deletions
diff --git a/openmp/tools/omptest/CMakeLists.txt b/openmp/tools/omptest/CMakeLists.txt
index 6bc32ab09992..10c0cd98ccbc 100644
--- a/openmp/tools/omptest/CMakeLists.txt
+++ b/openmp/tools/omptest/CMakeLists.txt
@@ -13,8 +13,8 @@ option(LIBOMPTEST_BUILD_STANDALONE
option(LIBOMPTEST_BUILD_UNITTESTS
"Build ompTest's unit tests, requires GoogleTest." OFF)
-# In absence of corresponding OMPT support: exit early
-if(NOT ${LIBOMP_OMPT_SUPPORT})
+# Exit early if OMPT support or LLVM-tests were disabled by the user.
+if((NOT ${LIBOMP_OMPT_SUPPORT}) OR (NOT ${LLVM_INCLUDE_TESTS}))
return()
endif()
@@ -61,12 +61,7 @@ if ((NOT LIBOMPTEST_BUILD_STANDALONE) OR LIBOMPTEST_BUILD_UNITTESTS)
set(LIBOMPTEST_BUILD_STANDALONE OFF)
endif()
- # Make sure target llvm_gtest is available
- if (NOT TARGET llvm_gtest)
- message(FATAL_ERROR "Required target not found: llvm_gtest")
- endif()
-
- # Add llvm_gtest as dependency
+ # Add dependency llvm_gtest; emits error if unavailable.
add_dependencies(omptest llvm_gtest)
# Link llvm_gtest as whole-archive to expose required symbols