From 939893c09297aae9c1cd374a101441db7ab280da Mon Sep 17 00:00:00 2001 From: osfans Date: Tue, 16 May 2017 21:35:43 +0800 Subject: [PATCH] fix(cmake): fix build break for mingw --- src/CMakeLists.txt | 4 ++++ test/CMakeLists.txt | 2 +- tools/CMakeLists.txt | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 716a7a1b6..4675311d0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -45,6 +45,10 @@ set(rime_extra_deps ${Marisa_LIBRARY} ${Opencc_LIBRARY}) +if(MINGW) + set(rime_core_deps ${rime_core_deps} wsock32 ws2_32) +endif() + if(BUILD_SEPARATE_LIBS) set(rime_deps ${rime_core_deps}) set(rime_gears_deps ${rime_library} ${rime_extra_deps}) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4ff66b8ea..89ef556cb 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -if(NOT (MSVC AND BUILD_SHARED_LIBS)) +if(NOT (WIN32 AND BUILD_SHARED_LIBS)) aux_source_directory(. rime_test_src) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/test) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 0eab982c7..3945ef902 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -11,7 +11,7 @@ target_link_libraries(rime_patch ${rime_library} ${rime_gears_library}) add_dependencies(rime_patch ${rime_library} ${rime_gears_library}) # msvc doesn't export all symbols -if(NOT (MSVC AND BUILD_SHARED_LIBS)) +if(NOT (WIN32 AND BUILD_SHARED_LIBS)) set(rime_console_src "rime_console.cc") add_executable(rime_console ${rime_console_src})