File tree Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Original file line number Diff line number Diff 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).
Original file line number Diff line number Diff 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)
1515add_executable (omptest-unittests ${UNITTEST_SOURCES} )
You can’t perform that action at this time.
0 commit comments