[Openmp-commits] [openmp] [OpenMP] Fix buildbot patch when openmp is enabled as project (PR #76141)

Ethan Luis McDonough via Openmp-commits openmp-commits at lists.llvm.org
Thu Dec 21 01:56:51 PST 2023

https://github.com/EthanLuisMcDonough created https://github.com/llvm/llvm-project/pull/76141

This patch addresses an issue introduced in pull request #74398. CMake will attempt to re-build gtest if openmp is enabled as a project (as opposed to being enabled as a runtime). This patch adds a check that prevents this from happening.

>From f8a6567e5af478a80f5d962826da49b0335c7eb6 Mon Sep 17 00:00:00 2001
From: Ethan Luis McDonough <ethanluismcdonough at gmail.com>
Date: Thu, 21 Dec 2023 03:53:24 -0600
Subject: [PATCH] Fix buildbot patch when openmp is enabled as project

 openmp/libomptarget/CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/openmp/libomptarget/CMakeLists.txt b/openmp/libomptarget/CMakeLists.txt
index 7060e20af09324..31e475d86960ae 100644
--- a/openmp/libomptarget/CMakeLists.txt
+++ b/openmp/libomptarget/CMakeLists.txt
@@ -153,6 +153,8 @@ add_subdirectory(test)
 # Add unit tests if GMock/GTest is present
-  add_subdirectory(${LLVM_THIRD_PARTY_DIR}/unittest ${CMAKE_CURRENT_BINARY_DIR}/third-party/unittest)
+  if (NOT TARGET llvm_gtest)
+    add_subdirectory(${LLVM_THIRD_PARTY_DIR}/unittest ${CMAKE_CURRENT_BINARY_DIR}/third-party/unittest)
+  endif()

More information about the Openmp-commits mailing list