-
Notifications
You must be signed in to change notification settings - Fork 27
/
settings.cmake
142 lines (116 loc) · 4.71 KB
/
settings.cmake
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#
# Copyright 2019, Data61, CSIRO (ABN 41 687 119 230)
#
# SPDX-License-Identifier: BSD-2-Clause
#
cmake_minimum_required(VERSION 3.7.2)
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/apps/Arm/${CAMKES_VM_APP}")
set(AppArch "Arm" CACHE STRING "" FORCE)
elseif(EXISTS "${CMAKE_CURRENT_LIST_DIR}/apps/x86/${CAMKES_VM_APP}")
set(AppArch "x86" CACHE STRING "" FORCE)
else()
message(FATAL_ERROR "App does not exist for supported architecture")
endif()
if(AppArch STREQUAL "Arm")
set(CAMKES_ARM_LINUX_DIR "${CMAKE_CURRENT_LIST_DIR}/linux" CACHE STRING "")
set(project_dir "${CMAKE_CURRENT_LIST_DIR}/../../")
file(GLOB project_modules ${project_dir}/projects/*)
list(
APPEND
CMAKE_MODULE_PATH
${project_dir}/kernel
${project_dir}/tools/seL4/cmake-tool/helpers/
${project_dir}/tools/seL4/elfloader-tool/
${project_modules}
)
set(SEL4_CONFIG_DEFAULT_ADVANCED ON)
set(CAMKES_CONFIG_DEFAULT_ADVANCED ON)
mark_as_advanced(CMAKE_INSTALL_PREFIX)
include(application_settings)
include(${CMAKE_CURRENT_LIST_DIR}/easy-settings.cmake)
# Kernel settings
set(KernelArch "arm" CACHE STRING "" FORCE)
if(AARCH64)
set(KernelSel4Arch "aarch64" CACHE STRING "" FORCE)
else()
set(KernelSel4Arch "arm_hyp" CACHE STRING "" FORCE)
set(ARM_HYP ON CACHE INTERNAL "" FORCE)
endif()
set(KernelArmHypervisorSupport ON CACHE BOOL "" FORCE)
set(KernelRootCNodeSizeBits 18 CACHE STRING "" FORCE)
set(KernelArmVtimerUpdateVOffset OFF CACHE BOOL "" FORCE)
set(KernelArmDisableWFIWFETraps ON CACHE BOOL "" FORCE)
# capDL settings
set(CapDLLoaderMaxObjects 90000 CACHE STRING "" FORCE)
# CAmkES Settings
set(CAmkESCPP ON CACHE BOOL "" FORCE)
# Release settings
# message(FATAL_ERROR "release is ${RELEASE}")
ApplyCommonReleaseVerificationSettings(${RELEASE} FALSE)
if(NOT CAMKES_VM_APP)
message(
FATAL_ERROR
"CAMKES_VM_APP is not defined. Pass CAMKES_VM_APP to specify the VM application to build e.g. vm_minimal, odroid_vm"
)
endif()
# Add VM application
include("${CMAKE_CURRENT_LIST_DIR}/apps/Arm/${CAMKES_VM_APP}/settings.cmake")
correct_platform_strings()
find_package(seL4 REQUIRED)
sel4_configure_platform_settings()
ApplyData61ElfLoaderSettings(${KernelARMPlatform} ${KernelSel4Arch})
if(NUM_NODES MATCHES "^[0-9]+$")
set(KernelMaxNumNodes ${NUM_NODES} CACHE STRING "" FORCE)
else()
set(KernelMaxNumNodes 1 CACHE STRING "" FORCE)
endif()
# We dont support SMP configurations on the exynos5422, exynos5410 or TK1
if(
("${KernelARMPlatform}" STREQUAL "exynos5422"
OR "${KernelARMPlatform}" STREQUAL "exynos5410"
OR "${KernelARMPlatform}" STREQUAL "tk1"
)
AND (${KernelMaxNumNodes} GREATER 1)
)
message(FATAL_ERROR "${KernelARMPlatform} does not support SMP VMs")
endif()
elseif(AppArch STREQUAL "x86")
set(project_dir "${CMAKE_CURRENT_LIST_DIR}")
get_filename_component(resolved_path ${CMAKE_CURRENT_LIST_FILE} REALPATH)
# repo_dir is distinct from project_dir as this file is symlinked.
# project_dir corresponds to the top level project directory, and
# repo_dir is the absolute path after following the symlink.
get_filename_component(repo_dir ${resolved_path} DIRECTORY)
set(project_dir "${CMAKE_CURRENT_LIST_DIR}/../../")
file(GLOB project_modules ${project_dir}/projects/*)
list(
APPEND
CMAKE_MODULE_PATH
${project_dir}/kernel
${project_dir}/projects/seL4_tools/cmake-tool/helpers/
${project_dir}/projects/seL4_tools/elfloader-tool/
${project_dir}/tools/seL4/cmake-tool/helpers/
${project_dir}/tools/seL4/elfloader-tool/
${project_modules}
)
set(LIBZMQ_PATH ${project_dir}/projects/libzmq CACHE INTERNAL "")
include(application_settings)
# message(FATAL_ERROR "${CAMKES_VM_SETTINGS_PATH}")
find_package(camkes-vm REQUIRED)
include(${CAMKES_VM_SETTINGS_PATH})
if(NOT CAMKES_VM_APP)
set(CAMKES_VM_APP "optiplex9020" CACHE INTERNAL "")
endif()
# message(WARNING "project dir is ${repo_dir}")
# message(FATAL_ERROR ${repo_dir}/apps/${CAMKES_VM_APP}/app_settings.cmake"")
include("${repo_dir}/apps/x86/${CAMKES_VM_APP}/app_settings.cmake")
find_package(seL4 REQUIRED)
sel4_configure_platform_settings()
if(SIMULATION)
ApplyCommonSimulationSettings(${KernelSel4Arch})
# Force IOMMU back on after CommonSimulationSettings disabled it
set(KernelIOMMU ON CACHE BOOL "" FORCE)
endif()
else()
message(FATAL_ERROR "Unsupported Setting")
endif()