Skip to content

Commit ea8691c

Browse files
authored
Don't build any binaries for 3rd party deps like sentencepiece (#105)
* Don't build any binaries for 3rd party deps like sentencepiece * Update CMakeLists.txt * Update CMakeLists.txt
1 parent 14a80d3 commit ea8691c

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

CMakeLists.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,20 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
3838

3939
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third-party/abseil-cpp)
4040
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third-party/re2)
41-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third-party/sentencepiece)
41+
42+
if(NOT DEFINED SPM_BUILD_TEST)
43+
set(SPM_BUILD_TEST OFF CACHE BOOL "")
44+
endif()
45+
46+
if(NOT DEFINED SPM_ENABLE_SHARED)
47+
set(SPM_ENABLE_SHARED OFF CACHE BOOL "")
48+
endif()
49+
50+
add_subdirectory(
51+
${CMAKE_CURRENT_SOURCE_DIR}/third-party/sentencepiece
52+
${CMAKE_CURRENT_BINARY_DIR}/sentencepiece-build
53+
EXCLUDE_FROM_ALL
54+
)
4255

4356
set(CMAKE_POSITION_INDEPENDENT_CODE ${_pic_flag})
4457

0 commit comments

Comments
 (0)