[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:12 PDT 2024


https://github.com/estewart08 created https://github.com/llvm/llvm-project/pull/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.

>From df5f0ae6e860e9f38a9d6f543eed81584091f45d Mon Sep 17 00:00:00 2001
From: Ethan Stewart <ethan.stewart at amd.com>
Date: Fri, 7 Jun 2024 15:17:29 -0500
Subject: [PATCH] [OpenMP][Offload] - Ensure OPENMP_STANDALONE_BUILD is defined

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.
---
 offload/CMakeLists.txt | 2 ++
 openmp/CMakeLists.txt  | 2 ++
 2 files changed, 4 insertions(+)

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