blob: 6f4d6398b06d7e8b6e83c0c7ddd4bfc08e765892 [file] [log] [blame]
Satish Kumar427923c2021-10-05 07:21:53 +01001#-------------------------------------------------------------------------------
Mathias Brossard6cff9c22025-02-19 22:25:51 -06002# Copyright (c) 2020-2025, Arm Limited. All rights reserved.
Satish Kumar427923c2021-10-05 07:21:53 +01003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8
9list(APPEND CMAKE_MODULE_PATH ${PSA_ADAC_ROOT}/cmake)
10
11set(PSA_ADAC_TOOLCHAIN TRUE CACHE BOOL "Whether to use psa-adac toolchain.")
12
13set(PSA_ADAC_EC_P256 On CACHE BOOL "Enable support for ECDSA P-256")
Mathias Brossard6cff9c22025-02-19 22:25:51 -060014set(PSA_ADAC_EC_P384 On CACHE BOOL "Enable support for ECDSA P-384")
Satish Kumar427923c2021-10-05 07:21:53 +010015set(PSA_ADAC_EC_P521 On CACHE BOOL "Enable support for ECDSA P-521")
16set(PSA_ADAC_RSA3072 On CACHE BOOL "Enable support for RSA 3072")
17set(PSA_ADAC_RSA4096 On CACHE BOOL "Enable support for RSA 4096")
18set(PSA_ADAC_ED25519 Off CACHE BOOL "Enable support for EdDSA Ed25519")
19set(PSA_ADAC_ED448 Off CACHE BOOL "Enable support for EdDSA Ed448")
20set(PSA_ADAC_SM2SM3 Off CACHE BOOL "Enable support for SM2/SM3")
21set(PSA_ADAC_CMAC On CACHE BOOL "Enable support for CMAC AES-128")
22set(PSA_ADAC_HMAC On CACHE BOOL "Enable support for HMAC SHA-256")
23set(PSA_ADAC_HW_CRYPTO Off CACHE BOOL "Support for hardware cryptography")
24set(PSA_ADAC_DEBUG Off CACHE BOOL "Enable debug")
25set(PSA_ADAC_QUIET Off CACHE BOOL "Disable console output")
26set(PSA_ADAC_QEMU Off CACHE BOOL "The image will be built to run on QEMU")
27set(PSA_ADAC_MINIMUM_SIZE_CONFIG Off CACHE BOOL "Size-optimized build (reduced features)")
28
29if (CMAKE_BUILD_TYPE STREQUAL "Debug")
30 set(PSA_ADAC_DEBUG On)
31 set(PSA_ADAC_TRACE Off)
32elseif (CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
33 set(PSA_ADAC_QUIET On)
34 set(PSA_ADAC_DEBUG Off)
35endif ()
36
37if (ROM_POC) # TODO: this is just for transition, remove soon
38 set(PSA_ADAC_MINIMUM_SIZE_CONFIG On)
39endif ()
40
41if (PSA_ADAC_MINIMUM_SIZE_CONFIG AND NOT (PLATFORM_NAME STREQUAL "native"))
42 # set(PSA_ADAC_EC_P256 On)
Mathias Brossard6cff9c22025-02-19 22:25:51 -060043 set(PSA_ADAC_EC_P384 Off)
Satish Kumar427923c2021-10-05 07:21:53 +010044 set(PSA_ADAC_EC_P521 Off)
45 set(PSA_ADAC_RSA3072 Off)
46 set(PSA_ADAC_RSA4096 Off)
47 set(PSA_ADAC_ED25519 Off)
48 set(PSA_ADAC_ED448 Off)
49 set(PSA_ADAC_SM2SM3 Off)
50 set(PSA_ADAC_CMAC Off)
51 set(PSA_ADAC_HMAC Off)
52endif ()
53
54find_program(CCACHE_PROGRAM ccache)
55if (CCACHE_PROGRAM)
56 set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
57endif ()