Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Exclude FetchContent targets #22

Merged
merged 3 commits into from
Feb 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ FetchContent_Declare(
URL https://github.com/google/sentencepiece/archive/refs/tags/v0.1.99.tar.gz
URL_HASH SHA256=63617eaf56c7a3857597dcd8780461f57dd21381b56a27716ef7d7e02e14ced4
)
FetchContent_MakeAvailable(sentencepiece)
set_property(DIRECTORY ${sentencepiece_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL ON)
FetchContent_GetProperties(sentencepiece)
if(NOT sentencepiece_POPULATED)
FetchContent_Populate(sentencepiece)
add_subdirectory(${sentencepiece_SOURCE_DIR} ${sentencepiece_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()


if(BUILD_FAST_TOKENIZERS)
FetchContent_Declare(
Expand Down Expand Up @@ -102,8 +106,11 @@ else()
URL https://github.com/google/re2/archive/refs/tags/2022-04-01.tar.gz
URL_HASH SHA256=1ae8ccfdb1066a731bba6ee0881baad5efd2cd661acd9569b689f2586e1a50e9
)
FetchContent_MakeAvailable(re2)
set_property(DIRECTORY ${re2_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL ON)
FetchContent_GetProperties(re2)
if(NOT re2_POPULATED)
FetchContent_Populate(re2)
add_subdirectory(${re2_SOURCE_DIR} ${re2_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
elseif(LINUX AND X86_64)
FetchContent_Declare(
fast_tokenizer
Expand Down Expand Up @@ -135,6 +142,7 @@ else()
endif()

FetchContent_MakeAvailable(fast_tokenizer)

# to allow find_library to work with conda-forge env
set(_old_CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ${CMAKE_FIND_ROOT_PATH_MODE_LIBRARY})
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
Expand Down
Loading