Skip to content

Commit 939893c

Browse files
committed
fix(cmake): fix build break for mingw
1 parent 33101c0 commit 939893c

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ set(rime_extra_deps
4545
${Marisa_LIBRARY}
4646
${Opencc_LIBRARY})
4747

48+
if(MINGW)
49+
set(rime_core_deps ${rime_core_deps} wsock32 ws2_32)
50+
endif()
51+
4852
if(BUILD_SEPARATE_LIBS)
4953
set(rime_deps ${rime_core_deps})
5054
set(rime_gears_deps ${rime_library} ${rime_extra_deps})

test/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if(NOT (MSVC AND BUILD_SHARED_LIBS))
1+
if(NOT (WIN32 AND BUILD_SHARED_LIBS))
22

33
aux_source_directory(. rime_test_src)
44
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/test)

tools/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ target_link_libraries(rime_patch ${rime_library} ${rime_gears_library})
1111
add_dependencies(rime_patch ${rime_library} ${rime_gears_library})
1212

1313
# msvc doesn't export all symbols
14-
if(NOT (MSVC AND BUILD_SHARED_LIBS))
14+
if(NOT (WIN32 AND BUILD_SHARED_LIBS))
1515

1616
set(rime_console_src "rime_console.cc")
1717
add_executable(rime_console ${rime_console_src})

0 commit comments

Comments
 (0)