generated from ut-issl/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
78 lines (63 loc) · 2.16 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
## CMake file for S2E integration
cmake_minimum_required(VERSION 3.13)
project(C2A)
option(BUILD_C2A_AS_CXX "Build C2A as C++" OFF)
option(BUILD_C2A_AS_SILS_FW "Build C2A as SILS firmware" ON)
# UART COM for connection to PC UART
# これをONにした状態でTMTC_IFが動いていない場合,そちらのバッファが詰まってSILSの動作が止まることがあるので注意すること!
option(USE_UART_COM "Use UART COM" OFF)
set(C2A_CORE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/src_core)
set(C2A_USER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/src_user)
set(C2A_SATELLITE_PARAMETERS_DIR SatelliteParameters/Sample) # relative path from Settings
if(NOT BUILD_C2A_AS_CXX)
set(BUILD_C2A_AS_C99 ON)
endif()
set(USE_ALL_C2A_CORE_APPS OFF)
set(USE_ALL_C2A_CORE_TEST_APPS OFF)
set(USE_ALL_C2A_CORE_LIB ON)
set(C2A_SRCS
${C2A_CORE_DIR}/Applications/divided_cmd_utility.c
${C2A_CORE_DIR}/Applications/event_utility.c
${C2A_CORE_DIR}/Applications/gs_command_dispatcher.c
${C2A_CORE_DIR}/Applications/memory_dump.c
${C2A_CORE_DIR}/Applications/nop.c
${C2A_CORE_DIR}/Applications/realtime_command_dispatcher.c
${C2A_CORE_DIR}/Applications/timeline_command_dispatcher.c
# ${C2A_CORE_DIR}/Applications/utility_command.c
# ${C2A_CORE_DIR}/Applications/utility_counter.c
# SRC_USER codes
# ${C2A_USER_DIR}/C2A_main.c
)
include_directories(src)
add_subdirectory(${C2A_CORE_DIR})
add_subdirectory(${C2A_USER_DIR}/Applications)
add_subdirectory(${C2A_USER_DIR}/Drivers)
add_subdirectory(${C2A_USER_DIR}/IfWrapper)
add_subdirectory(${C2A_USER_DIR}/Library)
add_subdirectory(${C2A_USER_DIR}/Settings)
add_subdirectory(${C2A_USER_DIR}/TlmCmd)
add_library(${PROJECT_NAME} STATIC ${C2A_SRCS})
set(C2A_USER_MODULES
C2A_USER_APPS
C2A_USER_DRIVERS
C2A_USER_CMD_TLM
C2A_USER_IF_WRAPPER
C2A_USER_LIB
C2A_USER_SETTINGS
)
if(MSVC)
target_link_options(${PROJECT_NAME} PRIVATE "/WHOLEARCHIVE")
target_link_libraries(${PROJECT_NAME} PRIVATE
C2A_CORE
${C2A_USER_MODULES}
)
else()
target_link_libraries(${PROJECT_NAME} PRIVATE
-Wl,--whole-archive
C2A_CORE
-Wl,--no-whole-archive
${C2A_USER_MODULES}
-lm
)
endif()
include(${C2A_USER_DIR}/common.cmake)