[Openmp-commits] [openmp] [openmp][testing] disable check targets if not building with clang (PR #71866)

Maksim Levental via Openmp-commits openmp-commits at lists.llvm.org
Thu Nov 9 12:50:01 PST 2023


https://github.com/makslevental created https://github.com/llvm/llvm-project/pull/71866

Currently you can't build the openmp project (i.e., `-DLLVM_ENABLE_PROJECTS=mlir;openmp`) without also building clang. This fixes that and enables building the various openmp libs (such as `libomp`) by projects that have no need of clang.

>From 60b2750714bb69990491e1e69ffe5faa146fdee1 Mon Sep 17 00:00:00 2001
From: max <maksim.levental at gmail.com>
Date: Thu, 9 Nov 2023 14:44:17 -0600
Subject: [PATCH] [openmp][testing] disable check targets if not building with
 clang

---
 openmp/cmake/OpenMPTesting.cmake | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/openmp/cmake/OpenMPTesting.cmake b/openmp/cmake/OpenMPTesting.cmake
index a771efdf9e69a96..46a7950b28e5949 100644
--- a/openmp/cmake/OpenMPTesting.cmake
+++ b/openmp/cmake/OpenMPTesting.cmake
@@ -65,6 +65,11 @@ else()
   else()
     set(OPENMP_FILECHECK_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/FileCheck)
   endif()
+  if (NOT TARGET "clang")
+    message(STATUS "Cannot find 'clang'.")
+    message(WARNING "The check targets will not be available!")
+    set(ENABLE_CHECK_TARGETS FALSE)
+  endif ()
   set(OPENMP_NOT_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/not)
 endif()
 



More information about the Openmp-commits mailing list