[Openmp-commits] [openmp] f0129cc - [OpenMP] Disable tests if FileCheck is not available in in-tree building

Shilei Tian via Openmp-commits openmp-commits at lists.llvm.org
Mon Feb 1 10:15:02 PST 2021


Author: Shilei Tian
Date: 2021-02-01T13:14:55-05:00
New Revision: f0129cc35ebd4607c86f1f90cb664c86ffdb4a5c

URL: https://github.com/llvm/llvm-project/commit/f0129cc35ebd4607c86f1f90cb664c86ffdb4a5c
DIFF: https://github.com/llvm/llvm-project/commit/f0129cc35ebd4607c86f1f90cb664c86ffdb4a5c.diff

LOG: [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

Added: 
    

Modified: 
    openmp/cmake/OpenMPTesting.cmake

Removed: 
    


################################################################################
diff  --git a/openmp/cmake/OpenMPTesting.cmake b/openmp/cmake/OpenMPTesting.cmake
index 7290bc48969f..7c1be84f9292 100644
--- a/openmp/cmake/OpenMPTesting.cmake
+++ b/openmp/cmake/OpenMPTesting.cmake
@@ -58,7 +58,13 @@ if (${OPENMP_STANDALONE_BUILD})
   set(OPENMP_LIT_ARGS "${DEFAULT_LIT_ARGS}" CACHE STRING "Options for lit.")
   separate_arguments(OPENMP_LIT_ARGS)
 else()
-  set(OPENMP_FILECHECK_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/FileCheck)
+  if (NOT TARGET "FileCheck")
+    message(STATUS "Cannot find 'FileCheck'.")
+    message(WARNING "The check targets will not be available!")
+    set(ENABLE_CHECK_TARGETS FALSE)
+  else()
+    set(OPENMP_FILECHECK_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/FileCheck)
+  endif()
   set(OPENMP_NOT_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/not)
 endif()
 


        


More information about the Openmp-commits mailing list