Skip to content

Commit 2eb2841

Browse files
Fixed tokenizers on Windows (#141)
1 parent 37d20ce commit 2eb2841

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/CMakeLists.txt

+9-5
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,15 @@ else()
123123
URL https://github.com/google/re2/archive/refs/tags/2022-04-01.tar.gz
124124
URL_HASH SHA256=1ae8ccfdb1066a731bba6ee0881baad5efd2cd661acd9569b689f2586e1a50e9
125125
)
126-
FetchContent_GetProperties(re2)
127-
if(NOT re2_POPULATED)
128-
FetchContent_Populate(re2)
129-
add_subdirectory(${re2_SOURCE_DIR} ${re2_BINARY_DIR} EXCLUDE_FROM_ALL)
130-
endif()
126+
function(ov_tokenizers_build_static_re2)
127+
set(BUILD_SHARED_LIBS OFF)
128+
FetchContent_GetProperties(re2)
129+
if(NOT re2_POPULATED)
130+
FetchContent_Populate(re2)
131+
add_subdirectory(${re2_SOURCE_DIR} ${re2_BINARY_DIR} EXCLUDE_FROM_ALL)
132+
endif()
133+
endfunction()
134+
ov_tokenizers_build_static_re2()
131135
elseif(LINUX AND X86_64)
132136
FetchContent_Declare(
133137
fast_tokenizer

0 commit comments

Comments
 (0)