Skip to content

Commit

Permalink
[OpenMP][Offload] - Ensure OPENMP_STANDALONE_BUILD is defined (llvm#9…
Browse files Browse the repository at this point in the history
…4801)

Without a value set conditional checks like
if(NOT ${OPENMP_STANDALONE_BUILD})
will not be able to evaluate to true.
Fixes issue introduced from PR llvm#93463, which did not allow the OMPT
variable to be propogated up to offload during a runtimes build.

Signed-off-by: Hafidz Muzakky <ais.muzakky@gmail.com>
  • Loading branch information
estewart08 authored and nekoshirro committed Jun 9, 2024
1 parent 7e8be59 commit 85c89e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions offload/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ set(LLVM_SUBPROJECT_TITLE "liboffload")
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
set(OPENMP_STANDALONE_BUILD TRUE)
project(offload C CXX ASM)
else()
set(OPENMP_STANDALONE_BUILD FALSE)
endif()

# Check that the library can actually be built.
Expand Down
2 changes: 2 additions & 0 deletions openmp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ list(INSERT CMAKE_MODULE_PATH 0
if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
set(OPENMP_STANDALONE_BUILD TRUE)
project(openmp C CXX ASM)
else()
set(OPENMP_STANDALONE_BUILD FALSE)
endif()

# Must go below project(..)
Expand Down

0 comments on commit 85c89e3

Please sign in to comment.