Skip to content

Commit 0810505

Browse files
authored
[OpenMP][omptest] Skip omptest build if LLVM_INCLUDE_TESTS=OFF (#155020)
Add / expand early exit in CMakeLists.txt if LLVM_INCLUDE_TESTS is 'OFF'
1 parent 0bbb794 commit 0810505

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

openmp/tools/omptest/CMakeLists.txt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ option(LIBOMPTEST_BUILD_STANDALONE
1313
option(LIBOMPTEST_BUILD_UNITTESTS
1414
"Build ompTest's unit tests, requires GoogleTest." OFF)
1515

16-
# In absence of corresponding OMPT support: exit early
17-
if(NOT ${LIBOMP_OMPT_SUPPORT})
16+
# Exit early if OMPT support or LLVM-tests were disabled by the user.
17+
if((NOT ${LIBOMP_OMPT_SUPPORT}) OR (NOT ${LLVM_INCLUDE_TESTS}))
1818
return()
1919
endif()
2020

@@ -61,12 +61,7 @@ if ((NOT LIBOMPTEST_BUILD_STANDALONE) OR LIBOMPTEST_BUILD_UNITTESTS)
6161
set(LIBOMPTEST_BUILD_STANDALONE OFF)
6262
endif()
6363

64-
# Make sure target llvm_gtest is available
65-
if (NOT TARGET llvm_gtest)
66-
message(FATAL_ERROR "Required target not found: llvm_gtest")
67-
endif()
68-
69-
# Add llvm_gtest as dependency
64+
# Add dependency llvm_gtest; emits error if unavailable.
7065
add_dependencies(omptest llvm_gtest)
7166

7267
# Link llvm_gtest as whole-archive to expose required symbols

0 commit comments

Comments
 (0)