blob: e1deb20b343032df3d4fe5cae854d9ecda7aa025 [file] [log] [blame]
Mate Toth-Pal65c935e2018-01-17 18:42:13 +01001#-------------------------------------------------------------------------------
2# Copyright (c) 2018, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8if(NOT DEFINED REGRESSION)
9 message(FATAL_ERROR "ERROR: Incomplete Configuration: REGRESSION not defined, Include this file from a Config*.cmake")
10elseif(NOT DEFINED CORE_TEST)
11 message(FATAL_ERROR "ERROR: Incomplete Configuration: CORE_TEST not defined, Include this file from a Config*.cmake")
12elseif(NOT DEFINED BL2)
13 message(FATAL_ERROR "ERROR: Incomplete Configuration: BL2 not defined, Include this file from a Config*.cmake")
14endif()
15
16##Shared compiler and linker settings.
17function(config_setting_shared_flags tgt)
18 embedded_set_target_compile_flags(TARGET ${tgt} LANGUAGE C FLAGS -xc -std=c99 -fshort-enums -mfpu=none -fshort-wchar -funsigned-char -mcmse -Wall -Werror)
19 embedded_set_target_link_flags(TARGET ${tgt} FLAGS --strict --map --symbols --xref --entry=Reset_Handler --info=summarysizes,sizes,totals,unused,veneers)
20endfunction()
21
22#Settings which shall be set for all projects the same way based
23# on the variables above.
24set (CORE_TEST_SERVICES OFF)
25set (CORE_TEST_POSITIVE OFF)
26set (CORE_TEST_INTERACTIVE OFF)
27
28if (REGRESSION)
29 set(SERVICES_TEST_ENABLED ON)
30else()
31 set(SERVICES_TEST_ENABLED OFF)
32endif()
33
34if (SERVICES_TEST_ENABLED)
35 set(SERVICE_TEST_S ON)
36 set(SERVICE_TEST_NS ON)
37 set(CORE_TEST_POSITIVE ON)
38 set(CORE_TEST_INTERACTIVE OFF)
39endif()
40
41if (CORE_TEST)
42 set(CORE_TEST_POSITIVE ON)
43 set(CORE_TEST_INTERACTIVE OFF)
44endif()
45
46if(CORE_TEST_INTERACTIVE)
47 add_definitions(-DCORE_TEST_INTERACTIVE)
48 set(TEST_FRAMEWORK_NS ON)
49 set(CORE_TEST_SERVICES ON)
50endif()
51
52if(CORE_TEST_POSITIVE)
53 add_definitions(-DCORE_TEST_POSITIVE)
54 set(TEST_FRAMEWORK_NS ON)
55 set(CORE_TEST_SERVICES ON)
56endif()
57
58if (SERVICE_TEST_S)
59 add_definitions(-DSERVICES_TEST_S)
60 set(TEST_FRAMEWORK_S ON)
61endif()
62
63if (SERVICE_TEST_NS)
64 add_definitions(-DSERVICES_TEST_NS)
65 set(TEST_FRAMEWORK_NS ON)
66endif()
67
68if(TEST_FRAMEWORK_S)
69 add_definitions(-DTEST_FRAMEWORK_S)
70endif()
71
72if(TEST_FRAMEWORK_NS)
73 add_definitions(-DTEST_FRAMEWORK_NS)
74endif()
75
76if (CORE_TEST_SERVICES)
77 add_definitions(-DCORE_TEST_SERVICES)
78endif()
79
80if (BL2)
81 add_definitions(-DBL2)
82endif()
83
84##Secure side
85config_setting_shared_flags(tfm_s)
86embedded_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")
87
88##Non secure side
89config_setting_shared_flags(tfm_ns)
90embedded_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")
91
92##TF-M storage
93config_setting_shared_flags(tfm_storage)
94set(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")
95
96set (SST_ENCRYPTION ON)
97set (SST_RAM_FS ON)
98set (SST_VALIDATE_METADATA_FROM_FLASH ON)
99set (ENABLE_SECURE_STORAGE ON)
100set (MBEDTLS_DEBUG ON)
101
102##Tests
103config_setting_shared_flags(tfm_secure_tests)
104config_setting_shared_flags(tfm_non_secure_tests)
105
106##BL2
107config_setting_shared_flags(mcuboot)
108set(MBEDTLS_C_FLAGS_BL2 "-D__ARM_FEATURE_CMSE=3 -D__thumb2__ -fshort-enums -mfpu=none -fshort-wchar -funsigned-char -mcmse -DMBEDTLS_CONFIG_FILE=\\\\\\\"config-boot.h\\\\\\\" -I${CMAKE_CURRENT_LIST_DIR}/bl2/ext/mcuboot/include")