-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ if(CMAKE_C_COMPILER_ID MATCHES GNU|Clang) | |
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_SHARED_LINKER_FLAGS}") | ||
endif() | ||
endif() | ||
elseif(CMAKE_C_COMPILER_ID MATCHES MSVC) | ||
elseif(MSVC) | ||
# /wd4819 | ||
# Without BOM, Visual Studio does not treat source file as UTF-8 | ||
# encoding, thus it will complain about invalid character. Use | ||
|
@@ -54,8 +54,6 @@ elseif(CMAKE_C_COMPILER_ID MATCHES MSVC) | |
if(MSVC_VERSION LESS 1900) | ||
add_compile_definitions(snprintf=_snprintf) | ||
endif() | ||
|
||
set(BUILD_SHARED_LIBS OFF) | ||
endif() | ||
|
||
|
||
|
@@ -70,7 +68,7 @@ add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) | |
|
||
option(WITH_SQLITE3 "Use sqlite3 to store userphrase" true) | ||
option(WITH_INTERNAL_SQLITE3 "Use internal sqlite3" false) | ||
if(CMAKE_C_COMPILER_ID MATCHES MSVC) | ||
if(MSVC) | ||
set(WITH_INTERNAL_SQLITE3 true) | ||
endif() | ||
|
||
|
@@ -274,7 +272,7 @@ if(NOT WITH_RUST) | |
target_link_libraries(libchewing | ||
PRIVATE common | ||
PRIVATE userphrase) | ||
if(BUILD_SHARED_LIBS AND CMAKE_C_COMPILER_ID MATCHES MSVC) | ||
if(BUILD_SHARED_LIBS AND MSVC) | ||
target_compile_definitions(libchewing PRIVATE CHEWINGDLL_EXPORTS) | ||
endif() | ||
endif() | ||
|
@@ -297,7 +295,7 @@ if(WITH_RUST) | |
PRIVATE LINKER:-exported_symbols_list,${CMAKE_BINARY_DIR}/symbols.map | ||
PRIVATE LINKER:-dead_strip | ||
) | ||
elseif(CMAKE_C_COMPILER_ID MATCHES MSVC) | ||
elseif(MSVC) | ||
target_link_options(libchewing PRIVATE "/DEF ${CMAKE_BINARY_DIR}/symbols.map") | ||
set_target_properties(libchewing PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreadedDLL") | ||
endif() | ||
|
@@ -306,12 +304,17 @@ elseif(WITH_SQLITE3) | |
target_link_libraries(libchewing PRIVATE ${SQLite3_LIBRARIES}) | ||
endif() | ||
|
||
|
||
set_target_properties(libchewing PROPERTIES | ||
OUTPUT_NAME chewing | ||
SOVERSION 3 | ||
VERSION 3.3.1 | ||
) | ||
if(MSVC) | ||
set_target_properties(libchewing PROPERTIES | ||
OUTPUT_NAME chewing-msvc | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
kanru
Author
Member
|
||
) | ||
else() | ||
set_target_properties(libchewing PROPERTIES | ||
OUTPUT_NAME chewing | ||
SOVERSION 3 | ||
VERSION 3.3.1 | ||
) | ||
endif() | ||
|
||
install(FILES ${ALL_INC} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/chewing) | ||
install(FILES ${PROJECT_BINARY_DIR}/chewing.pc | ||
|
@kanru
This rename here and commit 0e4beca broke compilation in downstream project.
In windows-chewing-tsf it expects a static library with the name
chewing_static.lib
. Source code here:https://github.com/chewing/windows-chewing-tsf/blob/4a2303fab60e7859213547e6c129fc8da11ca262/ChewingTextService/CMakeLists.txt#L32
https://github.com/chewing/windows-chewing-tsf/blob/4a2303fab60e7859213547e6c129fc8da11ca262/chewingwrapper/CMakeLists.txt#L23
Any advice? Update windows-chewing-tsf to use the shared library (
chewing-msvc
)?