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

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


Author: estewart08
Date: 2024-06-07T15:37:42-05:00
New Revision: 89c92b0bcf4b9a283ed594e01a4addd90e5d8735

URL: https://github.com/llvm/llvm-project/commit/89c92b0bcf4b9a283ed594e01a4addd90e5d8735
DIFF: https://github.com/llvm/llvm-project/commit/89c92b0bcf4b9a283ed594e01a4addd90e5d8735.diff

LOG: [OpenMP][Offload] - Ensure OPENMP_STANDALONE_BUILD is defined (#94801)

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.

Added: 
    

Modified: 
    offload/CMakeLists.txt
    openmp/CMakeLists.txt

Removed: 
    


################################################################################
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(..)


        


More information about the Openmp-commits mailing list