@@ -18,11 +18,11 @@ set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL ON)
18
18
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$" )
19
19
set (c_cxx_flags "-Wno-undef" )
20
20
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" )
21
+ # C4146: unary minus operator applied to unsigned type, result still unsigned
21
22
# C4244: 'argument' : conversion from 'type1' to 'type2', possible loss of data
22
23
# C4267: 'var' : conversion from 'size_t' to 'type', possible loss of data
23
- set (c_cxx_flags "/wd4244 /wd4267" )
24
- # for fast tokenizers
25
- set (c_cxx_flags "${c_cxx_flags} /wd4146 /wd4700" )
24
+ # C4700: uninitialized local variable 'var' used
25
+ set (c_cxx_flags "/wd4146 /wd4244 /wd4267 /wd4700" )
26
26
endif ()
27
27
28
28
include (CheckCXXCompilerFlag)
@@ -61,7 +61,10 @@ if(BUILD_FAST_TOKENIZERS)
61
61
fast_tokenizer
62
62
)
63
63
set (WITH_PYTHON OFF CACHE BOOL "Disable Python API for fast_tokenizer" )
64
- add_subdirectory (${fast_tokenizer_SOURCE_DIR} /fast_tokenizer ${CMAKE_CURRENT_BINARY_DIR} /fast_tokenizer)
64
+ add_subdirectory (${fast_tokenizer_SOURCE_DIR} /fast_tokenizer
65
+ ${CMAKE_CURRENT_BINARY_DIR} /fast_tokenizer
66
+ EXCLUDE_FROM_ALL
67
+ )
65
68
endif ()
66
69
67
70
# variables used later
@@ -147,9 +150,10 @@ endif()
147
150
target_link_libraries (${TARGET_NAME} PRIVATE ${FAST_TOKENIZER_LIBS} sentencepiece-static )
148
151
149
152
# string_view is used from cxx17
150
- string (REPLACE " " ";" cxx_flags "${cxx_flags} " )
151
- set_target_properties (${TARGET_NAME} PROPERTIES CXX_STANDARD 17
152
- COMPILE_OPTIONS "${cxx_flags} " )
153
+ set_target_properties (${TARGET_NAME} PROPERTIES CXX_STANDARD 17)
154
+
155
+ string (REPLACE " " ";" extra_flags "${c_cxx_flags} ${cxx_flags} " )
156
+ set_target_properties (${TARGET_NAME} PROPERTIES COMPILE_OPTIONS "${extra_flags} " )
153
157
154
158
#
155
159
# Post build steps to copy core_tokenizers dependencies
0 commit comments