Skip to content

Commit

Permalink
test: copy librime targets files to test on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiredPlanck committed Oct 29, 2023
1 parent 25193bd commit af4b7a3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
if(WIN32)
if(BUILD_SHARED_LIBS AND BUILD_SEPARATE_LIBS)
add_custom_target(copy_librime_to_test
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${rime_library}> ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${rime_dict_library}> ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${rime_gears_library}> ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Copying librime (separated) to test"
)
else()
add_custom_target(copy_librime_to_test
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${rime_library}> ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Copying librime (full) to test"
)
endif()
endif()

aux_source_directory(. rime_test_src)
add_executable(rime_test ${rime_test_src})
target_link_libraries(rime_test
Expand All @@ -12,3 +28,6 @@ endif(BUILD_SHARED_LIBS)

add_test(NAME rime_test COMMAND rime_test
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/data/test")
if(WIN32)
add_dependencies(rime_test copy_librime_to_test)
endif()

0 comments on commit af4b7a3

Please sign in to comment.