Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
snnn committed Feb 18, 2025
1 parent 66eb178 commit 674a544
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions cmake/externals/dlib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FetchContent_Declare(
URL_HASH SHA1=59b1fb4e9909697c646e4f74e94871dacf49f0bf
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
SOURCE_SUBDIR not_set
FIND_PACKAGE_ARGS NAMES dlib
)

FetchContent_MakeAvailable(dlib)
3 changes: 3 additions & 0 deletions cmake/externals/googlere2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ FetchContent_Declare(
GIT_REPOSITORY https://github.com/google/re2.git
GIT_TAG 2021-06-01
EXCLUDE_FROM_ALL
FIND_PACKAGE_ARGS NAMES re2
)

FetchContent_MakeAvailable(googlere2)
if(TARGET re2)
set_target_properties(re2
PROPERTIES
POSITION_INDEPENDENT_CODE ON
FOLDER externals/google)
endif()
14 changes: 9 additions & 5 deletions cmake/externals/sentencepieceproject.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if(NOT _ONNXRUNTIME_EMBEDDED)
GIT_TAG v21.12
EXCLUDE_FROM_ALL
PATCH_COMMAND git checkout . && git apply --ignore-space-change --ignore-whitespace ${PROJECT_SOURCE_DIR}/cmake/externals/protobuf_cmake.patch
FIND_PACKAGE_ARGS NAMES Protobuf protobuf
)

set(protobuf_BUILD_TESTS OFF CACHE BOOL "Build tests")
Expand All @@ -29,8 +30,10 @@ if(NOT _ONNXRUNTIME_EMBEDDED)
set(protobuf_DISABLE_RTTI ON CACHE BOOL "Disable RTTI")

FetchContent_MakeAvailable(protobuf)
set_target_properties(libprotobuf-lite PROPERTIES
if(TARGET libprotobuf-lite)
set_target_properties(libprotobuf-lite PROPERTIES
FOLDER externals/google)
endif()
endif()

# To avoid creating complicated logic to build protoc, especially for mobile platforms, we use the pre-generated pb files
Expand Down Expand Up @@ -63,10 +66,11 @@ if(NOT protobuf_SOURCE_DIR)
endif()

FetchContent_MakeAvailable(spm)
target_link_libraries(sentencepiece-static PUBLIC protobuf::libprotobuf-lite)
set_target_properties(sentencepiece-static PROPERTIES
FOLDER externals/google)

if(TARGET sentencepiece-static)
target_link_libraries(sentencepiece-static PUBLIC protobuf::libprotobuf-lite)
set_target_properties(sentencepiece-static PROPERTIES
FOLDER externals/google)
endif()
set(spm_INCLUDE_DIRS
${protobuf_SOURCE_DIR}/src
${spm_SOURCE_DIR}/src/builtin_pb
Expand Down

0 comments on commit 674a544

Please sign in to comment.