sentencepiece/only-install-proto-headers-if-not-using-builtin-prot.patch
2021-11-27 19:37:28 +08:00

30 lines
1023 B
Diff

From a069cd5518c11750b734b85887dcc74ec6f9457f Mon Sep 17 00:00:00 2001
From: mark <erasaur@gmail.com>
Date: Wed, 10 Feb 2021 10:59:56 -0800
Subject: [PATCH 6/7] only install proto headers if not using builtin proto
---
src/CMakeLists.txt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 87765e5..3d31259 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -272,8 +272,11 @@ install(TARGETS ${SPM_INSTALLTARGETS}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
-install(FILES sentencepiece_trainer.h sentencepiece_processor.h
+install(FILES sentencepiece_trainer.h sentencepiece_processor.h ${SPM_PROTO_HDRS}
DESTINATION ${CMAKE_INSTALL_INCDIR})
+if (NOT SPM_USE_BUILTIN_PROTOBUF)
+ install(FILES ${SPM_PROTO_HDRS} DESTINATION ${CMAKE_INSTALL_INCDIR})
+endif()
file(TO_NATIVE_PATH "${PROJECT_SOURCE_DIR}/data" data_dir)
--
2.18.0.huawei.25