Skip to content

Commit 5f7848c

Browse files
sloretzahcorde
andauthored
Link against GTest::gmock target (#1699)
* Link against GTest::gmock target Linking against the target makes sure GTEST_LINKED_AS_SHARED_LIBRARY=1 is defined, which makes sure the object files and the other tests both expect to get the gtest symbols from another dll on windows. Signed-off-by: Shane Loretz <sloretz@intrinsic.ai> Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com> Co-authored-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
1 parent 0a44588 commit 5f7848c

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

rviz_common/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,10 @@ if(BUILD_TESTING)
361361
target_include_directories(test_support_objects PRIVATE
362362
include
363363
test
364-
${rviz_common_INCLUDE_DIRS}
365-
${GMOCK_INCLUDE_DIRS}
366-
${GTEST_INCLUDE_DIRS}
367364
)
368365
target_link_libraries(test_support_objects PUBLIC
369366
rviz_common
367+
GTest::gmock
370368
Qt${QT_VERSION_MAJOR}::Widgets
371369
rviz_ogre_vendor::OgreMain
372370
rviz_ogre_vendor::OgreOverlay

rviz_default_plugins/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,9 @@ if(BUILD_TESTING)
375375
target_include_directories(test_fixture_objects PRIVATE
376376
${TEST_INCLUDE_DIRS}
377377
include
378-
${GMOCK_INCLUDE_DIRS}
379-
${GTEST_INCLUDE_DIRS}
380378
)
381379
target_link_libraries(test_fixture_objects PUBLIC
380+
GTest::gmock
382381
rclcpp::rclcpp
383382
rviz_common::rviz_common
384383
rviz_ogre_vendor::OgreMain

0 commit comments

Comments
 (0)