forked from wangzhaode/onnx-llm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
32 lines (22 loc) · 977 Bytes
/
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
cmake_minimum_required(VERSION 3.5)
project(onnx-llm)
option(BUILD_FOR_ANDROID "Build for android whith mini memory mode." OFF)
option(LLM_SUPPORT_VISION "Llm model support vision input." OFF)
option(DUMP_PROFILE_INFO "Dump profile info when chat." OFF)
option(BUILD_JNI "Build JNI for android app." OFF)
if (DUMP_PROFILE_INFO)
add_definitions(-DDUMP_PROFILE_INFO)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
set(ONNXRUNTIME_PATH ${CMAKE_SOURCE_DIR}/3rd_party/onnxruntime)
link_directories(${ONNXRUNTIME_PATH}/lib)
include_directories(${ONNXRUNTIME_PATH}/include
${CMAKE_SOURCE_DIR}/include)
FILE(GLOB SRCS ${CMAKE_CURRENT_LIST_DIR}/src/*.cpp)
add_library(llm STATIC ${SRCS})
target_link_libraries(llm onnxruntime)
add_executable(cli_demo ${CMAKE_SOURCE_DIR}/demo/cli_demo.cpp)
target_link_libraries(cli_demo llm)