[Openmp-commits] [openmp] [OpenMP][omptest] Improve CMake and address review comments (PR #159416)

Michael Halkenhäuser via Openmp-commits openmp-commits at lists.llvm.org
Mon Jan 19 09:32:29 PST 2026


================
@@ -65,27 +73,34 @@ if ((NOT LIBOMPTEST_BUILD_STANDALONE) OR LIBOMPTEST_BUILD_UNITTESTS)
     set(LIBOMPTEST_BUILD_STANDALONE OFF)
   endif()
 
-  # Add dependency llvm_gtest; emits error if unavailable.
-  add_dependencies(omptest llvm_gtest)
-
-  # Link llvm_gtest as whole-archive to expose required symbols
-  set(GTEST_LINK_CMD "-Wl,--whole-archive" llvm_gtest
-                     "-Wl,--no-whole-archive" LLVMSupport)
-
-  # Add GoogleTest-based header
-  target_sources(omptest PRIVATE ./include/OmptTesterGoogleTest.h)
+  message(STATUS "omptest build mode: GTest-based")
 
-  # Add LLVM-provided GoogleTest include directories.
-  target_include_directories(omptest PRIVATE
-    ${LLVM_THIRD_PARTY_DIR}/unittest/googletest/include)
-
-  # TODO: Re-visit ABI breaking checks, disable for now.
-  target_compile_definitions(omptest PUBLIC
-    -DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING)
-
-  # Link against gtest and gtest_main
-  target_link_libraries(omptest PRIVATE ${GTEST_LINK_CMD})
+  # Add GoogleTest-based header and embed GTest symbols into the shared lib.
+  # Merging of GTest is desired, such that omptest is self-contained and
+  # independent of external GTest installations.
+  target_sources(omptest PRIVATE
+    ./include/OmptTesterGoogleTest.h
----------------
mhalk wrote:

Fixed. Good catch, somehow that slipped my mind and eyes.

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


More information about the Openmp-commits mailing list