Skip to content

Commit

Permalink
build: workaround linking issue on msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
kanru committed Jan 1, 2024
1 parent f1083e9 commit 5b35fe9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ endif()
foreach(target ${ALL_TESTS})
add_executable(${target} ${TEST_SRC_DIR}/${target}.c)
target_link_libraries(${target} testhelper)
target_link_libraries(${target} libchewing)
# XXX workaround MSVC issue
if(MSVC AND WITH_RUST)
target_link_libraries(${target} chewing)
else()
target_link_libraries(${target} libchewing)
endif()
target_compile_definitions(${target} PRIVATE
CHEWING_DATA_PREFIX=\"${DATA_BIN_DIR}\"
TEST_HASH_DIR=\"${TEST_BIN_DIR}\"
Expand All @@ -68,9 +73,6 @@ add_library(testhelper STATIC
${TEST_SRC_DIR}/testhelper.c
$<TARGET_OBJECTS:common>
)
# if (NOT WITH_RUST)
# target_link_libraries(testhelper userphrase)
# endif()
target_compile_definitions(testhelper PRIVATE
CHEWING_DATA_PREFIX=\"${DATA_BIN_DIR}\"
TEST_HASH_DIR=\"${TEST_BIN_DIR}\"
Expand All @@ -96,4 +98,4 @@ foreach(target ${ALL_STATIC_TEST})
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${TEST_SRC_DIR}/${target} ${TEST_BIN_DIR}/${target}
)
add_dependencies(check ${target})
endforeach()
endforeach()

0 comments on commit 5b35fe9

Please sign in to comment.