[Openmp-commits] [openmp] [OpenMP] Use "standalone" include path if clang is not being built (PR #143405)
Ross Brunton via Openmp-commits
openmp-commits at lists.llvm.org
Fri Aug 8 07:04:32 PDT 2025
https://github.com/RossBrunton updated https://github.com/llvm/llvm-project/pull/143405
>From 975cedd50839816d3782f237765ab1ded3027a11 Mon Sep 17 00:00:00 2001
From: Ross Brunton <ross at codeplay.com>
Date: Mon, 9 Jun 2025 16:41:39 +0100
Subject: [PATCH] [OpenMP] Use "standalone" include path if clang is not being
built
If clang is not being built as part of this build, install headers into
`include` rather than `lib/clang/21/include` (the latter, in clangless
builds, will not be automatically included in search paths).
This, combined with #143390 , allows builds that include OpenMP but not
clang to build successfully.
---
openmp/CMakeLists.txt | 2 +-
openmp/runtime/src/CMakeLists.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt
index edd79df7fb767..856d2803a2078 100644
--- a/openmp/CMakeLists.txt
+++ b/openmp/CMakeLists.txt
@@ -126,7 +126,7 @@ option(OPENMP_ENABLE_LIBOMPTARGET "Enable building libomptarget for offloading."
option(OPENMP_ENABLE_LIBOMP_PROFILING "Enable time profiling for libomp." OFF)
# Header install location
-if(NOT LLVM_TREE_AVAILABLE)
+if(NOT LLVM_TREE_AVAILABLE OR NOT Clang_DIR)
set(LIBOMP_HEADERS_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}")
else()
include(GetClangResourceDir)
diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
index 569061c6494b8..f8be260c5e53e 100644
--- a/openmp/runtime/src/CMakeLists.txt
+++ b/openmp/runtime/src/CMakeLists.txt
@@ -11,7 +11,7 @@
include(ExtendPath)
# The generated headers will be placed in clang's resource directory if present.
-if(NOT LLVM_TREE_AVAILABLE)
+if(NOT LLVM_TREE_AVAILABLE OR NOT Clang_DIR)
set(LIBOMP_HEADERS_INTDIR ${CMAKE_CURRENT_BINARY_DIR})
else()
set(LIBOMP_HEADERS_INTDIR ${LLVM_BINARY_DIR}/${LIBOMP_HEADERS_INSTALL_PATH})
More information about the Openmp-commits
mailing list