Gyorgy Szing | 30fa987 | 2017-12-05 01:08:47 +0000 | [diff] [blame^] | 1 | #------------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2017, Arm Limited. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
| 8 | #This file holds information of a specific build configuration of this project. |
| 9 | #Process this file only once. |
| 10 | #if(DEFINED EMBEDDED_PROJ_CONFIG_LOADED) |
| 11 | # return() |
| 12 | #endif() |
| 13 | #set(EMBEDDED_PROJ_CONFIG_LOADED True) |
| 14 | |
| 15 | #Include board specific config (CPU, etc...) |
| 16 | include("Common/BoardSSE200") |
| 17 | |
| 18 | #Use any ARMCLANG version found on PATH. Note: Only versions supported by the |
| 19 | #build system will work. A file cmake/Common/CompilerArmClangXY.cmake |
| 20 | #must be present with a matching version. |
| 21 | include("Common/FindArmClang") |
| 22 | include("Common/${ARMCLANG_MODULE}") |
| 23 | |
| 24 | ##These variables select how the projects are built. Each project will set |
| 25 | #various project specific settings (e.g. what files to build, macro |
| 26 | #definitions) based on these. |
| 27 | set (REGRESSION True) |
| 28 | set (CORE_TEST False) |
| 29 | set (MCUBOOT False) |
| 30 | |
| 31 | ##Shared compiler and linker settings. |
| 32 | function(config_setting_shared_flags tgt) |
| 33 | embedded_set_target_compile_flags(TARGET ${tgt} LANGUAGE C FLAGS -xc -std=c99 -fshort-enums -mfpu=none -fshort-wchar -funsigned-char -mcmse -Wall -Werror) |
| 34 | embedded_set_target_link_flags(TARGET ${tgt} FLAGS --strict --map --symbols --xref --entry=Reset_Handler --info=summarysizes,sizes,totals,unused,veneers) |
| 35 | endfunction() |
| 36 | |
| 37 | #Settings which shall be set for all projects the same way based |
| 38 | # on the variables above. |
| 39 | set (CORE_TEST_SERVICES False) |
| 40 | set (CORE_TEST_POSITIVE False) |
| 41 | set (CORE_TEST_INTERACTIVE False) |
| 42 | if (REGRESSION) |
| 43 | set(SERVICES_TEST_ENABLED True) |
| 44 | else() |
| 45 | set(SERVICES_TEST_ENABLED False) |
| 46 | endif() |
| 47 | |
| 48 | if (SERVICES_TEST_ENABLED) |
| 49 | set(SERVICE_TEST_S on) |
| 50 | set(SERVICE_TEST_NS on) |
| 51 | set(CORE_TEST_POSITIVE on) |
| 52 | set(CORE_TEST_INTERACTIVE Off) |
| 53 | endif() |
| 54 | |
| 55 | if (CORE_TEST) |
| 56 | set(CORE_TEST_POSITIVE on) |
| 57 | set(CORE_TEST_INTERACTIVE OFF) |
| 58 | endif() |
| 59 | |
| 60 | if(CORE_TEST_INTERACTIVE) |
| 61 | add_definitions(-DCORE_TEST_INTERACTIVE) |
| 62 | set(TEST_FRAMEWORK_NS On) |
| 63 | set(CORE_TEST_SERVICES On) |
| 64 | endif() |
| 65 | |
| 66 | if(CORE_TEST_POSITIVE) |
| 67 | add_definitions(-DCORE_TEST_POSITIVE) |
| 68 | set(TEST_FRAMEWORK_NS On) |
| 69 | set(CORE_TEST_SERVICES On) |
| 70 | endif() |
| 71 | |
| 72 | if (SERVICE_TEST_S) |
| 73 | add_definitions(-DSERVICES_TEST_S) |
| 74 | set(TEST_FRAMEWORK_S On) |
| 75 | endif() |
| 76 | |
| 77 | if (SERVICE_TEST_NS) |
| 78 | add_definitions(-DSERVICES_TEST_NS) |
| 79 | set(TEST_FRAMEWORK_NS On) |
| 80 | endif() |
| 81 | |
| 82 | if(TEST_FRAMEWORK_S) |
| 83 | add_definitions(-DTEST_FRAMEWORK_S) |
| 84 | endif() |
| 85 | |
| 86 | if(TEST_FRAMEWORK_NS) |
| 87 | add_definitions(-DTEST_FRAMEWORK_NS) |
| 88 | endif() |
| 89 | |
| 90 | if (CORE_TEST_SERVICES) |
| 91 | add_definitions(-DCORE_TEST_SERVICES) |
| 92 | endif() |
| 93 | |
| 94 | if (MCUBOOT) |
| 95 | add_definitions(-DMCUBOOT) |
| 96 | endif() |
| 97 | |
| 98 | ##Secure side |
| 99 | config_setting_shared_flags(tfm_s) |
| 100 | embedded_set_target_linker_file(TARGET tfm_s PATH "${CMAKE_CURRENT_LIST_DIR}/platform/ext/target/sse_200_mps2/sse_200/armclang/sse_200_s.sct") |
| 101 | |
| 102 | #Non secure side |
| 103 | config_setting_shared_flags(tfm_ns) |
| 104 | embedded_set_target_linker_file(TARGET tfm_ns PATH "${CMAKE_CURRENT_LIST_DIR}/platform/ext/target/sse_200_mps2/sse_200/armclang/sse_200_ns.sct") |
| 105 | |
| 106 | ##TF-M storage |
| 107 | config_setting_shared_flags(tfm_storage) |
| 108 | set(MBEDTLS_C_FLAGS "-D__ARM_FEATURE_CMSE=3 -D__thumb2__ -fshort-enums -mfpu=none -fshort-wchar -funsigned-char -mcmse -DMBEDTLS_CONFIG_FILE=\\\\\\\"mbedtls_config.h\\\\\\\" -I${CMAKE_CURRENT_LIST_DIR}/platform/ext/target/common") |
| 109 | |
| 110 | set (SST_ENCRYPTION ON) |
| 111 | set (SST_RAM_FS ON) |
| 112 | set (SST_VALIDATE_METADATA_FROM_FLASH ON) |
| 113 | set (ENABLE_SECURE_STORAGE ON) |
| 114 | set (MBEDTLS_DEBUG ON) |
| 115 | |
| 116 | ##Tests |
| 117 | config_setting_shared_flags(tfm_secure_tests) |
| 118 | config_setting_shared_flags(tfm_non_secure_tests) |