-
Notifications
You must be signed in to change notification settings - Fork 23
/
CMakeLists.txt
executable file
·38 lines (29 loc) · 1.32 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
35
36
37
38
cmake_minimum_required(VERSION 3.10)
project(codefuse)
if (NOT DEFINED TARGET_ARCH)
set(TARGET_ARCH pcie)
endif()
include_directories(${PROJECT_SOURCE_DIR}/../../../support/include)
if (${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "aarch64")
add_definitions(-DSOC_TARGET)
link_directories(${PROJECT_SOURCE_DIR}/../../../support/lib_soc)
message("SoC mode, starting......")
elseif (${TARGET_ARCH} STREQUAL "pcie")
add_definitions(-DPCIE_TARGET)
link_directories(${PROJECT_SOURCE_DIR}/../../../support/lib_pcie)
message("PCIE mode, starting......")
elseif (${TARGET_ARCH} STREQUAL "soc")
add_definitions(-DSOC_TARGET)
set(CMAKE_C_COMPILER /opt/aarch64-linux-gnu-7.5.0/bin/aarch64-linux-gnu-gcc)
set(CMAKE_ASM_COMPILER /opt/aarch64-linux-gnu-7.5.0/bin/aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER /opt/aarch64-linux-gnu-7.5.0/bin/aarch64-linux-gnu-g++)
link_directories(${PROJECT_SOURCE_DIR}/../../../support/lib_soc)
message("SoC mode, starting......")
endif()
add_definitions(-DDEBUG --std=c++17 -fPIC -Wall -Werror)
set(CMAKE_BUILD_TYPE "Debug")
find_package(pybind11 REQUIRED CONFIG)
file(GLOB CPP_FILES ${PROJECT_SOURCE_DIR}/*.cpp)
pybind11_add_module(chat ${CPP_FILES})
target_link_libraries(chat PUBLIC bmrt bmlib)
install(TARGETS chat DESTINATION python)