Skip to content

Commit cb3a893

Browse files
[OpenMP] Check for gtest when building libomptarget unit tests (#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.
1 parent 73948ec commit cb3a893

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

openmp/libomptarget/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ add_subdirectory(test)
153153

154154
# Add unit tests if GMock/GTest is present
155155
if (EXISTS ${LLVM_THIRD_PARTY_DIR}/unittest)
156-
add_subdirectory(${LLVM_THIRD_PARTY_DIR}/unittest ${CMAKE_CURRENT_BINARY_DIR}/third-party/unittest)
156+
if (NOT TARGET llvm_gtest)
157+
add_subdirectory(${LLVM_THIRD_PARTY_DIR}/unittest ${CMAKE_CURRENT_BINARY_DIR}/third-party/unittest)
158+
endif()
157159
add_subdirectory(unittests)
158160
endif()

0 commit comments

Comments
 (0)