From cd01a445b25d9bc2c06d3e60f26338a829b702b4 Mon Sep 17 00:00:00 2001 From: Kan-Ru Chen Date: Mon, 1 Jan 2024 23:13:47 +0900 Subject: [PATCH] build: ensure sqlite is linked after chewing-static --- CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 459b0ecfd..1f97dc8e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -277,12 +277,9 @@ if(NOT WITH_RUST) endif() endif() -if(WITH_SQLITE3) - target_link_libraries(libchewing PRIVATE ${SQLite3_LIBRARIES}) -endif() - if(WITH_RUST) target_link_libraries(libchewing PRIVATE chewing) + target_link_libraries(chewing INTERFACE ${SQLite3_LIBRARIES}) if(BUILD_SHARED_LIBS) if(CMAKE_C_COMPILER_ID MATCHES GNU|Clang) target_link_options(libchewing @@ -295,16 +292,19 @@ if(WITH_RUST) ) elseif(CMAKE_COMPILER_ID MATCHES AppleClang) target_link_options(libchewing - PRIVATE "LINKER:-exported_symbols_list,${CMAKE_BINARY_DIR}/symbols.map" - PRIVATE "LINKER-dead_strip" + PRIVATE LINKER:-exported_symbols_list,${CMAKE_BINARY_DIR}/symbols.map + PRIVATE LINKER:-dead_strip ) else() target_link_options(libchewing PRIVATE "/DEF ${CMAKE_BINARY_DIR}/symbols.map") set_target_properties(libchewing PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreadedDLL") endif() endif() +elseif(WITH_SQLITE3) + target_link_libraries(libchewing PRIVATE ${SQLite3_LIBRARIES}) endif() + set_target_properties(libchewing PROPERTIES OUTPUT_NAME chewing SOVERSION 3