Skip to content

Commit

Permalink
test: copy gtest target files on Windows
Browse files Browse the repository at this point in the history
... to make the test target file work.
  • Loading branch information
WhiredPlanck committed Oct 29, 2023
1 parent 8ee1a59 commit a60bc9d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,18 @@ if(BUILD_SHARED_LIBS)
target_compile_definitions(rime_test PRIVATE RIME_IMPORTS)
endif(BUILD_SHARED_LIBS)

if (WIN32)
add_custom_target(
copy_gtest_to_test
${CMAKE_COMMAND} -E copy $<TARGET_FILE:gtest> $<TARGET_FILE_DIR:rime_test>
COMMENT "Copying gtest to test"
)
add_custom_target(
copy_gtest_main_to_test
${CMAKE_COMMAND} -E copy $<TARGET_FILE:gtest_main> $<TARGET_FILE_DIR:rime_test>
COMMENT "Copying gtest_main to test"
)
endif()

add_test(NAME rime_test COMMAND rime_test
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/data/test")

0 comments on commit a60bc9d

Please sign in to comment.