-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
83 lines (59 loc) · 2.05 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
PROJECT (SAIPROJECT)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(CMAKE_BUILD_BOARD "x86")
#SET(CMAKE_BUILD_BOARD "arm")
SET(CMAKE_BUILD_TYPE "Debug")
SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -Werror -g2 -ggdb")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
#SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -m32")
#SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -m32")
SET(ARCH "uml")
#SET(ARCH "arm64")
IF(${ARCH} STREQUAL "arm64")
SET(CMAKE_C_COMPILER /opt/aarch64/bin/aarch64-linux-gnu-gcc)
SET(CMAKE_CXX_COMPILER /opt/aarch64/bin/aarch64-linux-gnu-g++)
ENDIF(${ARCH} STREQUAL "arm64")
SET(CHIPNAME "tsingma")
SET(SDKHOME "../sdk")
SET(CONFIG_DBCLIENT 0)
SET(CONFIG_SHELLMODE 1)
SET(CONFIG_SAICLI 1)
SET(CONFIG_PLATFORM "other")
IF(${ARCH} STREQUAL "uml")
ADD_DEFINITIONS(-DSDK_WORK_PLATFORM=1)
ADD_DEFINITIONS(-DSDK_WORK_ENV=1)
ELSE(${ARCH} STREQUAL "uml")
ADD_DEFINITIONS(-DSDK_WORK_PLATFORM=0)
ADD_DEFINITIONS(-DSDK_WORK_ENV=1)
ENDIF(${ARCH} STREQUAL "uml")
ADD_DEFINITIONS(-DSDK_IN_USERMODE)
IF(${CHIPNAME} STREQUAL "tsingma")
ADD_DEFINITIONS(-DTSINGMA)
ELSEIF(${CHIPNAME} STREQUAL "tsingma_mx")
ADD_DEFINITIONS(-DTSINGMA_MX)
ENDIF(${CHIPNAME} STREQUAL "tsingma")
IF(CONFIG_DBCLIENT)
SET(REDIS_INCLUDE_DIR "${SAIPROJECT_SOURCE_DIR}/db/redis/deps/hiredis")
ADD_DEFINITIONS(-DCONFIG_DBCLIENT)
ENDIF(CONFIG_DBCLIENT)
IF(${CONFIG_PLATFORM} STREQUAL "ctc")
ADD_DEFINITIONS(-DCTC_PLATFORM)
ENDIF(${CONFIG_PLATFORM} STREQUAL "ctc")
IF(CONFIG_SHELLMODE)
ADD_DEFINITIONS(-DSHELL_MODE)
ENDIF(CONFIG_SHELLMODE)
ADD_DEFINITIONS(-Wall)
ADD_DEFINITIONS(-fPIC -Wno-long-long -Wformat)
IF(${ARCH} STREQUAL "arm64")
ADD_DEFINITIONS(-Wno-unused )
ELSE(${ARCH} STREQUAL "arm64")
ADD_DEFINITIONS(-m64)
ENDIF(${ARCH} STREQUAL "arm64")
IF(CONFIG_DBCLIENT)
ADD_DEFINITIONS(-DCTCREDIS)
ADD_SUBDIRECTORY(db)
ENDIF(CONFIG_DBCLIENT)
ADD_SUBDIRECTORY(centec)
MESSAGE(STATUS "This is BINARY dir "${SAIPROJECT_BINARY_DIR})
MESSAGE(STATUS "This is SOURCE dir "${SAIPROJECT_SOURCE_DIR})
MESSAGE(STATUS "This is BOARD type "${CMAKE_BUILD_BOARD})