-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
34 lines (30 loc) · 1.12 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.11)
project(CGEMMA)
include(FetchContent)
set(CMAKE_MODULE_PATH ${CGEMMA_SOURCE_DIR}/cmake)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
# silence policy CMP0042 warning by enabling RPATH explicitly
if(APPLE AND NOT DEFINED CMAKE_MACOSX_RPATH)
set(CMAKE_MACOSX_RPATH TRUE)
endif()
FetchContent_Declare(gemma GIT_REPOSITORY https://github.com/google/gemma.cpp GIT_TAG origin/main)
FetchContent_GetProperties(gemma)
if(NOT gemma_POPULATED)
FetchContent_Populate(gemma)
add_subdirectory(${gemma_SOURCE_DIR} ${gemma_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
FetchContent_GetProperties(highway)
if(NOT highway_POPULATED)
FetchContent_Populate(highway)
add_subdirectory(${highway_SOURCE_DIR} ${highway_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
FetchContent_GetProperties(sentencepiece)
if(NOT sentencepiece_POPULATED)
FetchContent_Populate(sentencepiece)
add_subdirectory(${sentencepiece_SOURCE_DIR} ${sentencepiece_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
add_subdirectory(src)
add_subdirectory(tools)