[Openmp-commits] [llvm] [openmp] [OpenMP][Offload] - Ensure OPENMP_STANDALONE_BUILD is defined (PR #94801)

via Openmp-commits openmp-commits at lists.llvm.org
Fri Jun 7 13:21:40 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-offload

Author: None (estewart08)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/94801.diff


2 Files Affected:

- (modified) offload/CMakeLists.txt (+2) 
- (modified) openmp/CMakeLists.txt (+2) 


``````````diff
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(..)

``````````

</details>


https://github.com/llvm/llvm-project/pull/94801


More information about the Openmp-commits mailing list