From 2ba24f94ef7eda26bd1c328f01e3e7999b905af0 Mon Sep 17 00:00:00 2001 From: zhangjipeng Date: Thu, 18 Jul 2024 11:12:24 +0800 Subject: [PATCH] fix gtest windows --- unittest/unittest.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/unittest/unittest.cmake b/unittest/unittest.cmake index d742863..31c87aa 100644 --- a/unittest/unittest.cmake +++ b/unittest/unittest.cmake @@ -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 $ $ + COMMAND_EXPAND_LISTS + ) +endif () + add_test(NAME unittest COMMAND unit_test)