[Openmp-commits] [openmp] 9b2b5bf - [OpenMP] Fix LLVM_ENABLE_PROJECTS=openmp build (#151117)
via Openmp-commits
openmp-commits at lists.llvm.org
Tue Aug 5 04:42:49 PDT 2025
Author: Michael Kruse
Date: 2025-08-05T13:42:46+02:00
New Revision: 9b2b5bf8cd751fabccaca1b8847b4c291aa52081
URL: https://github.com/llvm/llvm-project/commit/9b2b5bf8cd751fabccaca1b8847b4c291aa52081
DIFF: https://github.com/llvm/llvm-project/commit/9b2b5bf8cd751fabccaca1b8847b4c291aa52081.diff
LOG: [OpenMP] Fix LLVM_ENABLE_PROJECTS=openmp build (#151117)
Set LLVM_TREE_AVAILABLE when not defined after #149871. In particular,
the LLVM build tree is obviously available with
`add_subdirectory(openmp)` from the LLVM build tree itself. Note that
this build mode is deprecated since #136314.
Added:
Modified:
openmp/CMakeLists.txt
Removed:
################################################################################
diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt
index ab34851d8961c..edd79df7fb767 100644
--- a/openmp/CMakeLists.txt
+++ b/openmp/CMakeLists.txt
@@ -21,6 +21,8 @@ endif()
include(GNUInstallDirs)
if (OPENMP_STANDALONE_BUILD)
+ set(LLVM_TREE_AVAILABLE False)
+
# CMAKE_BUILD_TYPE was not set, default to Release.
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
@@ -48,6 +50,15 @@ if (OPENMP_STANDALONE_BUILD)
set(CMAKE_CXX_STANDARD_REQUIRED NO)
set(CMAKE_CXX_EXTENSIONS NO)
else()
+ # Usually <llvm-project>/runtimes/CMakeLists.txt sets LLVM_TREE_AVAILABLE and
+ # we assume it is not available otherwise. The exception is that we are in an
+ # LLVM_ENABLE_PROJECTS=openmp build, the LLVM tree is actually available.
+ # Note that this build mode has been deprecated.
+ # See https://github.com/llvm/llvm-project/issues/124014
+ if (NOT LLVM_RUNTIMES_BUILD AND "openmp" IN_LIST LLVM_ENABLE_PROJECTS)
+ set(LLVM_TREE_AVAILABLE True)
+ endif ()
+
set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR})
# When building in tree we install the runtime according to the LLVM settings.
More information about the Openmp-commits
mailing list