Skip to content

Commit

Permalink
fix gtest windows
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangjipeng committed Jul 18, 2024
1 parent b021c6d commit 2ba24f9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions unittest/unittest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,13 @@ include_directories(${PROJECT_ROOT})
add_executable(unit_test ${UNIT_SOURCES})
target_link_libraries(unit_test PRIVATE GTest::GTest ${LIB_NAME})

if (WIN32)
add_custom_command(
TARGET unit_test POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_RUNTIME_DLLS:unit_test> $<TARGET_FILE_DIR:unit_test>
COMMAND_EXPAND_LISTS
)
endif ()

add_test(NAME unittest COMMAND unit_test)

0 comments on commit 2ba24f9

Please sign in to comment.