aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/sentencepiece/portfile.cmake
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/sentencepiece/portfile.cmake
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/sentencepiece/portfile.cmake')
-rw-r--r--vcpkg/ports/sentencepiece/portfile.cmake36
1 files changed, 36 insertions, 0 deletions
diff --git a/vcpkg/ports/sentencepiece/portfile.cmake b/vcpkg/ports/sentencepiece/portfile.cmake
new file mode 100644
index 0000000..bde53b3
--- /dev/null
+++ b/vcpkg/ports/sentencepiece/portfile.cmake
@@ -0,0 +1,36 @@
+if(VCPKG_TARGET_IS_WINDOWS)
+ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+endif()
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO google/sentencepiece
+ REF "v${VERSION}"
+ SHA512 012850b63b2323e16acc5dacc0a494ad3f6375425ee86274f0946032e47c088a3b307758b99d752fcf54acf76c82d7d13d0c14bbf07aa9b612c4f1fbd30cf1cf
+ HEAD_REF master
+ PATCHES
+ abseil.diff
+ linkage.diff
+)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SPM_ENABLE_SHARED)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DSPM_ENABLE_SHARED=${SPM_ENABLE_SHARED}
+ -DSPM_ENABLE_TCMALLOC=OFF
+ -DSPM_ABSL_PROVIDER=package
+ -DSPM_PROTOBUF_PROVIDER=package
+ -DPROTOBUF_LITE_LIBRARY=protobuf::libprotobuf-lite
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+vcpkg_fixup_pkgconfig()
+
+vcpkg_copy_tools(TOOL_NAMES spm_decode spm_encode spm_export_vocab spm_normalize spm_train AUTO_CLEAN)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")