-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
99 lines (88 loc) · 3.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
cmake_minimum_required(VERSION 3.12)
project(scapula NONE)
# Import CMake Modules
include(ExternalProject)
# Initialize top-level super build project
include(${CMAKE_SOURCE_DIR}/scripts/cmake/init_project.cmake)
# Download and build dependencies
include(${SCAPULA_SOURCE_DEPENDS_DIR}/dtc.cmake)
include(${SCAPULA_SOURCE_DEPENDS_DIR}/libfdt.cmake)
include(${SCAPULA_SOURCE_DEPENDS_DIR}/meson.cmake)
include(${SCAPULA_SOURCE_DEPENDS_DIR}/libc.cmake)
include(${SCAPULA_SOURCE_DEPENDS_DIR}/libmemory.cmake)
include(${SCAPULA_SOURCE_DEPENDS_DIR}/xml_specs.cmake)
include(${SCAPULA_SOURCE_DEPENDS_DIR}/shoulder.cmake)
# Generate testcase source code
add_subproject(
scapula
DEPENDS shoulder
DEPENDS sysreg_spec
DEPENDS a64_spec
DEPENDS a32_spec
SOURCE_DIR ${SCAPULA_SOURCE_ROOT_DIR}/scapula
INSTALL_PREFIX ${SCAPULA_AARCH64_INSTALL_PREFIX}
)
# Build the 64-bit Scapula OS testcase runtime environment
add_subproject(
scapula_os_aarch64
DEPENDS shoulder
DEPENDS libc
DEPENDS libmemory
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/scapula_os/src
TOOLCHAIN ${SCAPULA_SOURCE_CMAKE_DIR}/toolchain/aarch64-linux-gnu-gcc.cmake
INSTALL_PREFIX ${SCAPULA_AARCH64_INSTALL_PREFIX}
)
# Build the 32-bit Scapula OS testcase runtime environment
add_subproject(
scapula_os_aarch32
DEPENDS shoulder
DEPENDS libc
DEPENDS libmemory
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/scapula_os/src
TOOLCHAIN ${SCAPULA_SOURCE_CMAKE_DIR}/toolchain/arm-linux-gnueabihf-gcc.cmake
INSTALL_PREFIX ${SCAPULA_AARCH32_INSTALL_PREFIX}
)
# Build aarch32 testcases that were generated by scapula
add_subproject(
test_cases_aarch32
DEPENDS shoulder
DEPENDS scapula_os_aarch32
DEPENDS scapula
SOURCE_DIR ${SCAPULA_SOURCE_ROOT_DIR}/scripts/cmake/build_generated/aarch32
TOOLCHAIN ${SCAPULA_SOURCE_CMAKE_DIR}/toolchain/arm-linux-gnueabihf-gcc.cmake
INSTALL_PREFIX ${SCAPULA_AARCH32_INSTALL_PREFIX}
)
# Build aarch64 testcases that were generated by scapula
add_subproject(
test_cases_aarch64
DEPENDS shoulder
DEPENDS scapula_os_aarch64
DEPENDS scapula
SOURCE_DIR ${SCAPULA_SOURCE_ROOT_DIR}/scripts/cmake/build_generated/aarch64
TOOLCHAIN ${SCAPULA_SOURCE_CMAKE_DIR}/toolchain/aarch64-linux-gnu-gcc.cmake
INSTALL_PREFIX ${SCAPULA_AARCH64_INSTALL_PREFIX}
)
# Bundle up all of the above as a .fit image contained in a linkable archive
add_subproject(
images
DEPENDS dtc
DEPENDS test_cases_aarch32
DEPENDS test_cases_aarch64
SOURCE_DIR ${SCAPULA_SOURCE_ROOT_DIR}/scripts/cmake/build_generated/images
TOOLCHAIN ${SCAPULA_SOURCE_CMAKE_DIR}/toolchain/aarch64-linux-gnu-gcc.cmake
INSTALL_PREFIX ${SCAPULA_AARCH64_INSTALL_PREFIX}
)
# Build the Scapula Loader
add_subproject(
scapula_loader
DEPENDS dtc
DEPENDS libfdt
DEPENDS shoulder
DEPENDS scapula_os_aarch64
DEPENDS images
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/scapula_loader
TOOLCHAIN ${SCAPULA_SOURCE_CMAKE_DIR}/toolchain/aarch64-linux-gnu-gcc.cmake
INSTALL_PREFIX ${SCAPULA_AARCH64_INSTALL_PREFIX}
)
print_banner()
print_usage()