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 | #Include board specific config (CPU, etc...) |
| 10 | include("Common/BoardSSE200") |
| 11 | |
| 12 | #Use any ARMCLANG version found on PATH. Note: Only versions supported by the |
| 13 | #build system will work. A file cmake/Common/CompilerArmClangXY.cmake |
| 14 | #must be present with a matching version. |
| 15 | include("Common/FindArmClang") |
| 16 | include("Common/${ARMCLANG_MODULE}") |
| 17 | |
| 18 | ##These variables select how the projects are built. Each project will set |
| 19 | #various project specific settings (e.g. what files to build, macro |
| 20 | #definitions) based on these. |
| 21 | set (REGRESSION False) |
| 22 | set (CORE_TEST True) |
| 23 | set (MCUBOOT False) |
| 24 | |
| 25 | ##Shared compiler and linker settings. |
| 26 | function(config_setting_shared_flags tgt) |
| 27 | embedded_set_target_compile_flags(TARGET ${tgt} LANGUAGE C FLAGS -xc -std=c99 -fshort-enums -mfpu=none -fshort-wchar -funsigned-char -mcmse -Wall -Werror) |
| 28 | embedded_set_target_link_flags(TARGET ${tgt} FLAGS --strict --map --symbols --xref --entry=Reset_Handler --info=summarysizes,sizes,totals,unused,veneers) |
| 29 | endfunction() |
| 30 | |
| 31 | #Settings which shall be set for all projects the same way based |
| 32 | # on the variables above. |
| 33 | set (CORE_TEST_SERVICES False) |
| 34 | set (CORE_TEST_POSITIVE False) |
| 35 | set (CORE_TEST_INTERACTIVE False) |
| 36 | |
| 37 | if (REGRESSION) |
| 38 | set(SERVICES_TEST_ENABLED True) |
| 39 | else() |
| 40 | set(SERVICES_TEST_ENABLED False) |
| 41 | endif() |
| 42 | |
| 43 | if (SERVICES_TEST_ENABLED) |
| 44 | set(SERVICE_TEST_S on) |
| 45 | set(SERVICE_TEST_NS on) |
| 46 | set(CORE_TEST_POSITIVE on) |
| 47 | set(CORE_TEST_INTERACTIVE Off) |
| 48 | endif() |
| 49 | |
| 50 | if (CORE_TEST) |
| 51 | set(CORE_TEST_POSITIVE on) |
| 52 | set(CORE_TEST_INTERACTIVE OFF) |
| 53 | endif() |
| 54 | |
| 55 | if(CORE_TEST_INTERACTIVE) |
| 56 | add_definitions(-DCORE_TEST_INTERACTIVE) |
| 57 | set(TEST_FRAMEWORK_NS On) |
| 58 | set(CORE_TEST_SERVICES On) |
| 59 | endif() |
| 60 | |
| 61 | if(CORE_TEST_POSITIVE) |
| 62 | add_definitions(-DCORE_TEST_POSITIVE) |
| 63 | set(TEST_FRAMEWORK_NS On) |
| 64 | set(CORE_TEST_SERVICES On) |
| 65 | endif() |
| 66 | |
| 67 | if (SERVICE_TEST_S) |
| 68 | add_definitions(-DSERVICES_TEST_S) |
| 69 | set(TEST_FRAMEWORK_S On) |
| 70 | endif() |
| 71 | |
| 72 | if (SERVICE_TEST_NS) |
| 73 | add_definitions(-DSERVICES_TEST_NS) |
| 74 | set(TEST_FRAMEWORK_NS On) |
| 75 | endif() |
| 76 | |
| 77 | if(TEST_FRAMEWORK_S) |
| 78 | add_definitions(-DTEST_FRAMEWORK_S) |
| 79 | endif() |
| 80 | |
| 81 | if(TEST_FRAMEWORK_NS) |
| 82 | add_definitions(-DTEST_FRAMEWORK_NS) |
| 83 | endif() |
| 84 | |
| 85 | if (CORE_TEST_SERVICES) |
| 86 | add_definitions(-DCORE_TEST_SERVICES) |
| 87 | endif() |
| 88 | |
| 89 | if (MCUBOOT) |
| 90 | add_definitions(-DMCUBOOT) |
| 91 | endif() |
| 92 | |
| 93 | ##Secure side |
| 94 | config_setting_shared_flags(tfm_s) |
| 95 | 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") |
| 96 | |
| 97 | #Non secure side |
| 98 | config_setting_shared_flags(tfm_ns) |
| 99 | 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") |
| 100 | |
| 101 | ##TF-M storage |
| 102 | config_setting_shared_flags(tfm_storage) |
| 103 | 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") |
| 104 | |
| 105 | set (SST_ENCRYPTION ON) |
| 106 | set (SST_RAM_FS ON) |
| 107 | set (SST_VALIDATE_METADATA_FROM_FLASH ON) |
| 108 | set (ENABLE_SECURE_STORAGE ON) |
| 109 | set (MBEDTLS_DEBUG ON) |
| 110 | |
| 111 | ##Tests |
| 112 | config_setting_shared_flags(tfm_secure_tests) |
| 113 | config_setting_shared_flags(tfm_non_secure_tests) |