[OpenMP][Offload] - Ensure OPENMP_STANDALONE_BUILD is defined#94801
Merged
Conversation
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.
Member
|
@llvm/pr-subscribers-offload Author: None (estewart08) ChangesWithout a value set conditional checks like Full diff: https://github.com/llvm/llvm-project/pull/94801.diff 2 Files Affected:
diff --git a/offload/CMakeLists.txt b/offload/CMakeLists.txt
index 03b6201865620..ead2aed414ffe 100644
--- a/offload/CMakeLists.txt
+++ b/offload/CMakeLists.txt
@@ -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.
diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt
index e565354ccc7f2..3b4259dfa380e 100644
--- a/openmp/CMakeLists.txt
+++ b/openmp/CMakeLists.txt
@@ -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(..)
|
jhuber6
approved these changes
Jun 7, 2024
ronlieb
approved these changes
Jun 7, 2024
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 #93463, which did not allow the OMPT variable to be propogated up to offload during a runtimes build.