Skip to content

Commit f0129cc

Browse files
committed
[OpenMP] Disable tests if FileCheck is not available in in-tree building
FileCheck is required for OpenMP tests. The current detection can fail if building OpenMP in-tree when user sets `LLVM_INSTALL_TOOLCHAIN_ONLY=ON`. As a result, CMake will raise an error and the compilation will be broken. This patch fixed the issue. When `FileCheck` is not a target, tests will just be skipped. Reviewed By: jdoerfert, JonChesterfield Differential Revision: https://reviews.llvm.org/D95689
1 parent 3ffc53b commit f0129cc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

openmp/cmake/OpenMPTesting.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@ if (${OPENMP_STANDALONE_BUILD})
5858
set(OPENMP_LIT_ARGS "${DEFAULT_LIT_ARGS}" CACHE STRING "Options for lit.")
5959
separate_arguments(OPENMP_LIT_ARGS)
6060
else()
61-
set(OPENMP_FILECHECK_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/FileCheck)
61+
if (NOT TARGET "FileCheck")
62+
message(STATUS "Cannot find 'FileCheck'.")
63+
message(WARNING "The check targets will not be available!")
64+
set(ENABLE_CHECK_TARGETS FALSE)
65+
else()
66+
set(OPENMP_FILECHECK_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/FileCheck)
67+
endif()
6268
set(OPENMP_NOT_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/not)
6369
endif()
6470

0 commit comments

Comments
 (0)