Fix pkg-config file to avoid overlinking

When configured to use external protobuf, remove -lprotobuf-lite from
pkg-config file's Libs section. The sentencepiece libraries link with
libprotobuf-lite; it is not necessary for users of the sentencepiece
libraries to link with protobuf unless they are using static linking so
this should have been in Libs.private. Use Requires.private so that we
use protobuf's pkg-config file to get the flags.
This commit is contained in:
Ryan Schmidt 2023-05-21 13:38:08 -05:00
parent e081c671b2
commit 41835971b7
2 changed files with 3 additions and 2 deletions

View File

@ -75,7 +75,7 @@ endif()
if (SPM_USE_BUILTIN_PROTOBUF)
set(libprotobuf_lite "")
else()
set(libprotobuf_lite "-lprotobuf-lite")
set(libprotobuf_lite "protobuf-lite")
endif()
if (MSVC)

View File

@ -6,5 +6,6 @@ includedir=@includedir_for_pc_file@
Name: @PROJECT_NAME@
Description: Unsupervised text tokenizer and detokenizer for Neural Network-based text generation.
Version: @PROJECT_VERSION@
Libs: -L${libdir} -lsentencepiece -lsentencepiece_train @libprotobuf_lite@
Libs: -L${libdir} -lsentencepiece -lsentencepiece_train
Cflags: -I${includedir}
Requires.private: @libprotobuf_lite@