Disable static library explicitly
authorKentaro Hayashi <kenhys@xdump.org>
Wed, 28 Oct 2020 11:55:20 +0000 (20:55 +0900)
committerKentaro Hayashi <kenhys@xdump.org>
Wed, 18 Aug 2021 11:52:46 +0000 (12:52 +0100)
Gbp-Pq: Name disable-static-library.patch

src/CMakeLists.txt

index 8b7fb764469c84696782d3ce24391f4abaca4bda..f05bf34a413cc3f1284dff53ee9f8a0281e46567 100644 (file)
@@ -205,12 +205,6 @@ if (SPM_ENABLE_SHARED)
   add_library(sentencepiece_train SHARED ${SPM_TRAIN_SRCS})
 endif()
 
-add_library(sentencepiece-static STATIC ${SPM_SRCS})
-add_library(sentencepiece_train-static STATIC ${SPM_TRAIN_SRCS})
-
-target_link_libraries(sentencepiece-static INTERFACE ${SPM_LIBS})
-target_link_libraries(sentencepiece_train-static INTERFACE sentencepiece-static ${SPM_LIBS})
-
 if (SPM_ENABLE_SHARED)
   target_link_libraries(sentencepiece ${SPM_LIBS})
   target_link_libraries(sentencepiece_train ${SPM_LIBS} sentencepiece)
@@ -221,7 +215,7 @@ if (SPM_ENABLE_SHARED)
       (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "sh4"))
     list(APPEND SPM_LIBS "atomic")
   endif()
-  set(SPM_INSTALLTARGETS sentencepiece sentencepiece_train sentencepiece-static sentencepiece_train-static)
+  set(SPM_INSTALLTARGETS sentencepiece sentencepiece_train)
   set_target_properties(sentencepiece sentencepiece_train PROPERTIES SOVERSION 0 VERSION 0.0.0)
   set_target_properties(sentencepiece PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS YES)
   set_target_properties(sentencepiece_train PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS YES)
@@ -238,9 +232,6 @@ else()
   set(SPM_INSTALLTARGETS sentencepiece-static sentencepiece_train-static)
 endif()
 
-set_target_properties(sentencepiece-static PROPERTIES OUTPUT_NAME "sentencepiece")
-set_target_properties(sentencepiece_train-static PROPERTIES OUTPUT_NAME "sentencepiece_train")
-
 if (NOT MSVC)
   if (SPM_COVERAGE)
     set(CMAKE_CXX_FLAGS "-O0 -Wall -fPIC -coverage ${CMAKE_CXX_FLAGS}")