Skip to content

Commit ca62f9c

Browse files
committed
fixup! [OpenMP][omptest] Improve CMake and address review comments
1 parent 1f9670c commit ca62f9c

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

openmp/tools/omptest/CMakeLists.txt

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,31 +72,19 @@ if ((NOT LIBOMPTEST_BUILD_STANDALONE) OR LIBOMPTEST_BUILD_UNITTESTS)
7272
"Make sure LLVM_THIRD_PARTY_DIR is set properly.")
7373
endif()
7474

75-
# Build GTest as OBJECT library, so we can merge it into omptest.
76-
add_library(omptest_gtest OBJECT "${OMPTEST_GTEST_PATH}/src/gtest-all.cc")
77-
78-
# Ensure PIC for inclusion into a shared library on ELF platforms.
79-
set_target_properties(omptest_gtest PROPERTIES POSITION_INDEPENDENT_CODE ON)
80-
81-
# Set GTest include directories for omptest_gtest
82-
target_include_directories(omptest_gtest PRIVATE
83-
"${OMPTEST_GTEST_PATH}"
84-
"${OMPTEST_GTEST_PATH}/include"
85-
)
86-
8775
# Set GTest include directories for omptest
8876
target_include_directories(omptest PUBLIC
8977
$<BUILD_INTERFACE:${OMPTEST_GTEST_PATH}>
9078
$<BUILD_INTERFACE:${OMPTEST_GTEST_PATH}/include>
9179
)
9280

93-
# Avoid using LLVM-specific ostream helpers inside GoogleTest.
94-
target_compile_definitions(omptest_gtest PRIVATE GTEST_NO_LLVM_SUPPORT=1)
81+
# Make the targets default_gtest and default_gtest_main available.
82+
build_gtest()
9583

9684
# Add GoogleTest-based header and merge GTest into the shared lib.
9785
target_sources(omptest PRIVATE
9886
./include/OmptTesterGoogleTest.h
99-
$<TARGET_OBJECTS:omptest_gtest>
87+
$<TARGET_OBJECTS:default_gtest>
10088
)
10189

10290
# Link against LLVMSupport and Threads (recommended for GTest).

openmp/tools/omptest/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set(UNITTEST_SOURCES
99
unittests/asserter-seq-test.cpp
1010
unittests/internal-event-eq-test.cpp
1111
unittests/internal-event-tostring-test.cpp
12-
unittests/internal-util-test
12+
unittests/internal-util-test.cpp
1313
unittests/main-test.cpp
1414
)
1515
add_executable(omptest-unittests ${UNITTEST_SOURCES})

0 commit comments

Comments
 (0)