Skip to content

Commit bde90ab

Browse files
committed
[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.
1 parent 003145d commit bde90ab

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

openmp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ option(OPENMP_ENABLE_LIBOMPTARGET "Enable building libomptarget for offloading."
115115
option(OPENMP_ENABLE_LIBOMP_PROFILING "Enable time profiling for libomp." OFF)
116116

117117
# Header install location
118-
if(${OPENMP_STANDALONE_BUILD})
118+
if("${OPENMP_STANDALONE_BUILD}" OR NOT Clang_DIR)
119119
set(LIBOMP_HEADERS_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}")
120120
else()
121121
include(GetClangResourceDir)

openmp/runtime/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
include(ExtendPath)
1212

1313
# The generated headers will be placed in clang's resource directory if present.
14-
if(OPENMP_STANDALONE_BUILD OR NOT LLVM_RUNTIMES_BUILD)
14+
if(OPENMP_STANDALONE_BUILD OR NOT LLVM_RUNTIMES_BUILD OR NOT Clang_DIR)
1515
set(LIBOMP_HEADERS_INTDIR ${CMAKE_CURRENT_BINARY_DIR})
1616
else()
1717
set(LIBOMP_HEADERS_INTDIR ${LLVM_BINARY_DIR}/${LIBOMP_HEADERS_INSTALL_PATH})

0 commit comments

Comments
 (0)