CMake: Add KernelIsMCS option

This switches between master and mcs configurations.
This also adds a build system variable KernelPlatformSupportsMCS that
can be used to error on platforms that don't support MCS due to
unimplemented functionality.
This commit is contained in:
Kent McLeod
2019-08-01 18:26:52 +10:00
committed by Kent Mcleod
parent 940b43b767
commit caad010a09
2 changed files with 16 additions and 2 deletions

View File

@@ -14,8 +14,17 @@ cmake_minimum_required(VERSION 3.7.2)
set(configure_string "${config_configure_string}")
# Set kernel branch
config_set(KernelIsMaster KERNEL_MASTER ON)
config_option(
KernelIsMCS KERNEL_MCS "Use the MCS kernel configuration, which is not verified."
DEFAULT OFF
)
# Error for unsupported MCS platforms
if(KernelIsMCS AND (NOT KernelPlatformSupportsMCS))
message(
FATAL_ERROR "KernelIsMCS selected, but platform: ${KernelPlatform} does not support it."
)
endif()
# Proof based configuration variables
set(CSPEC_DIR "." CACHE PATH "")

View File

@@ -146,6 +146,10 @@ unset(KernelArmMachFeatureModifiers CACHE)
unset(KernelArmCPU CACHE)
unset(KernelArmArmV CACHE)
# Blacklist platforms without MCS support
unset(KernelPlatformSupportsMCS CACHE)
set(KernelPlatformSupportsMCS ON)
file(GLOB result ${CMAKE_CURRENT_LIST_DIR}/../src/plat/*/config.cmake)
list(SORT result)
@@ -167,6 +171,7 @@ config_set(KernelArchArmV6 ARCH_ARM_V6 "${KernelArchArmV6}")
config_set(KernelArchArmV7a ARCH_ARM_V7A "${KernelArchArmV7a}")
config_set(KernelArchArmV7ve ARCH_ARM_V7VE "${KernelArchArmV7ve}")
config_set(KernelArchArmV8a ARCH_ARM_V8A "${KernelArchArmV8a}")
set(KernelPlatformSupportsMCS "${KernelPlatformSupportsMCS}" CACHE INTERNAL "" FORCE)
# Check for v7ve before v7a as v7ve is a superset and we want to set the
# actual armv to that, but leave armv7a config enabled for anything that