forked from PaddlePaddle/PaddleNLP
-
Notifications
You must be signed in to change notification settings - Fork 1
/
FastTokenizer.cmake.in
44 lines (34 loc) Β· 1.23 KB
/
FastTokenizer.cmake.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
CMAKE_MINIMUM_REQUIRED (VERSION 3.12)
set(USE_ABI0 @USE_ABI0@)
if (NOT WIN32)
if (USE_ABI0)
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
else()
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=1)
endif()
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug Release
RelWithDebInfo MinSizeRel."
FORCE)
endif(NOT CMAKE_BUILD_TYPE)
if(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wno-narrowing")
else()
set(CMAKE_CXX_STANDARD 11)
endif()
set(LIBRARY_NAME core_tokenizers)
set(FAST_TOKENIZER_INCS "")
list(APPEND FAST_TOKENIZER_INCS ${CMAKE_CURRENT_LIST_DIR}/include)
list(APPEND FAST_TOKENIZER_INCS ${CMAKE_CURRENT_LIST_DIR}/third_party/include)
set(FAST_TOKENIZER_LIBS "")
find_library(FTLIB ${LIBRARY_NAME} ${CMAKE_CURRENT_LIST_DIR}/lib NO_DEFAULT_PATH)
list(APPEND FAST_TOKENIZER_LIBS ${FTLIB})
if (WIN32)
find_library(ICUDT icudt ${CMAKE_CURRENT_LIST_DIR}/third_party/lib NO_DEFAULT_PATH)
list(APPEND FAST_TOKENIZER_LIBS ${ICUDT})
find_library(ICUUC icuuc ${CMAKE_CURRENT_LIST_DIR}/third_party/lib NO_DEFAULT_PATH)
list(APPEND FAST_TOKENIZER_LIBS ${ICUUC})
endif()