| # Copyright 2020 Google LLC | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # https://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| cmake_minimum_required(VERSION 3.7.2) | |
| 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(PICOTCP_PATH "${project_dir}/projects/picotcp" CACHE INTERNAL "") | |
| set(OPENSBI_PATH "${project_dir}/tools/opensbi" CACHE STRING "OpenSBI Folder location") | |
| set(COGENT_PATH ${project_dir}/tools/cogent/cogent CACHE INTERNAL "") | |
| set(RUMPRUN_PATH ${project_dir}/tools/rumprun CACHE INTERNAL "") | |
| set(SEL4_CONFIG_DEFAULT_ADVANCED ON) | |
| include(application_settings) | |
| include(${CMAKE_CURRENT_LIST_DIR}/easy-settings.cmake) | |
| # figure out the valid apps | |
| set(app_names "") | |
| file(GLOB apps ${CMAKE_CURRENT_LIST_DIR}/apps/*) | |
| foreach(ARG ${apps}) | |
| get_filename_component(filename ${ARG} NAME) | |
| list(APPEND app_names "${filename}") | |
| endforeach() | |
| string( | |
| REPLACE | |
| ";" | |
| "\n " | |
| app_names_error | |
| "${app_names}" | |
| ) | |
| if("${CAMKES_APP}" STREQUAL "") | |
| message( | |
| FATAL_ERROR "Missing option -DCAMKES_APP=<app> to build. Valid apps:\n ${app_names_error}" | |
| ) | |
| endif() | |
| list(FIND app_names "${CAMKES_APP}" app_exists) | |
| if(${app_exists} EQUAL -1) | |
| message( | |
| FATAL_ERROR | |
| "Invalid value for option -DCAMKES_APP=${CAMKES_APP}. Valid options:\n ${app_names_error}" | |
| ) | |
| endif() | |
| if(ARM_HYP) | |
| set(KernelArmHypervisorSupport ON CACHE BOOL "" FORCE) | |
| endif() | |
| correct_platform_strings() | |
| find_package(seL4 REQUIRED) | |
| sel4_configure_platform_settings() | |
| set(valid_platforms ${KernelPlatform_all_strings} ${correct_platform_strings_platform_aliases}) | |
| set_property(CACHE PLATFORM PROPERTY STRINGS ${valid_platforms}) | |
| if(NOT "${PLATFORM}" IN_LIST valid_platforms) | |
| message(FATAL_ERROR "Invalid PLATFORM selected: \"${PLATFORM}\" | |
| Valid platforms are: \"${valid_platforms}\"") | |
| endif() | |
| if(SIMULATION) | |
| ApplyCommonSimulationSettings(${KernelSel4Arch}) | |
| endif() | |
| ApplyCommonReleaseVerificationSettings(${RELEASE} FALSE) | |
| # NB: do platform-specific overrides now that KernelPlatform is set by sel4_configure_platform_settings | |
| include(apps/${CAMKES_APP}/platforms/${KernelPlatform}/easy-settings.cmake OPTIONAL) |