[Openmp-commits] [openmp] [OpenMP] Use Clang resource dir only in bootstrapping build (PR #156018)

Michael Kruse via Openmp-commits openmp-commits at lists.llvm.org
Fri Aug 29 10:29:55 PDT 2025


https://github.com/Meinersbur updated https://github.com/llvm/llvm-project/pull/156018

>From 0f4a5b4a1bb733f5608403f2b4b96c6f08ec8a8e Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Fri, 29 Aug 2025 14:29:43 +0200
Subject: [PATCH 1/2] [OpenMP] Use Clang resource dir only in bootstrapping
 build

---
 openmp/runtime/src/CMakeLists.txt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
index b22d03d168419..0140c68d64458 100644
--- a/openmp/runtime/src/CMakeLists.txt
+++ b/openmp/runtime/src/CMakeLists.txt
@@ -10,8 +10,9 @@
 
 include(ExtendPath)
 
-# The generated headers will be placed in clang's resource directory if present.
-if(NOT LLVM_TREE_AVAILABLE)
+# The generated headers will be placed in clang's resource if using it to
+# compile openmp in a runtimes-bootstrapping build.
+if(NOT LLVM_RUNTIMES_BUILD)
   set(LIBOMP_HEADERS_INTDIR ${CMAKE_CURRENT_BINARY_DIR})
 else()
   set(LIBOMP_HEADERS_INTDIR ${LLVM_BINARY_DIR}/${LIBOMP_HEADERS_INSTALL_PATH})

>From 3ce157cbb3bce9e2360371593a8c9cceb6b7ff8f Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Fri, 29 Aug 2025 19:06:46 +0200
Subject: [PATCH 2/2] Consider non-bootstrapping runtimes build

---
 openmp/runtime/src/CMakeLists.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
index 0140c68d64458..6ac047a833fe5 100644
--- a/openmp/runtime/src/CMakeLists.txt
+++ b/openmp/runtime/src/CMakeLists.txt
@@ -12,10 +12,10 @@ include(ExtendPath)
 
 # The generated headers will be placed in clang's resource if using it to
 # compile openmp in a runtimes-bootstrapping build.
-if(NOT LLVM_RUNTIMES_BUILD)
-  set(LIBOMP_HEADERS_INTDIR ${CMAKE_CURRENT_BINARY_DIR})
-else()
+if(LLVM_TREE_AVAILABLE AND LLVM_RUNTIMES_BUILD)
   set(LIBOMP_HEADERS_INTDIR ${LLVM_BINARY_DIR}/${LIBOMP_HEADERS_INSTALL_PATH})
+else()
+  set(LIBOMP_HEADERS_INTDIR ${CMAKE_CURRENT_BINARY_DIR})
 endif()
 
 # Configure omp.h, kmp_config.h and omp-tools.h if necessary



More information about the Openmp-commits mailing list