se-proxy: Enable compile time service selection
Integrate compile time service selection changes to common se-proxy
components. This enables the feature on the Corstone1000 and fvp-base
platforms.
Signed-off-by: Gyorgy Szing <gyorgy.szing@arm.com>
Change-Id: I26093fb70b423ada8b97eec9cbc620e993baafb8
diff --git a/deployments/se-proxy/se-proxy.cmake b/deployments/se-proxy/se-proxy.cmake
index 53bbf95..a205bc2 100644
--- a/deployments/se-proxy/se-proxy.cmake
+++ b/deployments/se-proxy/se-proxy.cmake
@@ -1,10 +1,23 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2021-2025, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
+# Check config options
+foreach( _cfg IN ITEMS CFG_ENABLE_ITS CFG_ENABLE_PS CFG_ENABLE_CRYPTO CFG_ENABLE_IAT CFG_ENABLE_FWU)
+ if( NOT DEFINED ${_cfg})
+ message(FATAL_ERROR "Mandatory variable \"${_cfg}\" is not defined.")
+ endif()
+endforeach()
+
+target_include_directories(se-proxy PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
+
+#-------------------------------------------------------------------------------
+# Service specific components
+#
+#-------------------------------------------------------------------------------
add_components(TARGET "se-proxy"
BASE_DIR ${TS_ROOT}
COMPONENTS
@@ -12,13 +25,27 @@
"components/rpc/common/interface"
"components/rpc/common/endpoint"
"components/service/common/include"
- "components/service/common/serializer/protobuf"
"components/service/common/client"
"components/service/common/provider"
+)
+
+if (CFG_ENABLE_PS OR CFG_ENABLE_ITS)
+add_components(TARGET "se-proxy"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/service/secure_storage/include"
+ "components/service/secure_storage/frontend/secure_storage_provider"
+ "protocols/service/secure_storage/packed-c"
+)
+endif()
+
+if (CFG_ENABLE_CRYPTO)
+add_components(TARGET "se-proxy"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
"components/service/crypto/client/psa"
"components/service/crypto/include"
"components/service/crypto/provider"
- "components/service/crypto/provider/serializer/protobuf"
"components/service/crypto/provider/serializer/packed-c"
"components/service/crypto/provider/extension/hash"
"components/service/crypto/provider/extension/hash/serializer/packed-c"
@@ -31,29 +58,51 @@
"components/service/crypto/provider/extension/aead"
"components/service/crypto/provider/extension/aead/serializer/packed-c"
"components/service/crypto/factory/full"
- "components/service/secure_storage/include"
- "components/service/secure_storage/frontend/secure_storage_provider"
+)
+
+if (CFG_ENABLE_CRYPTO_NANO)
+add_components(TARGET "se-proxy"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/service/common/serializer/protobuf"
+ "components/service/crypto/provider/serializer/protobuf"
+ "protocols/service/crypto/protobuf"
+)
+endif()
+
+endif()
+
+if(CFG_ENABLE_IAT)
+add_components(TARGET "se-proxy"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
"components/service/attestation/include"
"components/service/attestation/provider"
"components/service/attestation/provider/serializer/packed-c"
"protocols/rpc/common/packed-c"
- "protocols/service/secure_storage/packed-c"
- "protocols/service/crypto/protobuf"
)
+endif()
+if (CFG_ENABLE_FWU)
+add_components(TARGET "se-proxy"
+ BASE_DIR ${TS_ROOT}
+ COMPONENTS
+ "components/service/fwu/common"
+ "components/service/fwu/provider"
+ "components/service/fwu/provider/serializer"
+ "components/service/secure_storage/backend/secure_storage_ipc"
+)
+endif()
#-------------------------------------------------------------------------------
# Components used from external projects
#
#-------------------------------------------------------------------------------
# Nanopb
-include(${TS_ROOT}/external/nanopb/nanopb.cmake)
-target_link_libraries(se-proxy PRIVATE nanopb::protobuf-nanopb-static)
-protobuf_generate_all(TGT "se-proxy" NAMESPACE "protobuf" BASE_DIR "${TS_ROOT}/protocols")
+if (CFG_ENABLE_CRYPTO_NANO)
+ include(${TS_ROOT}/external/nanopb/nanopb.cmake)
+ target_link_libraries(se-proxy PRIVATE nanopb::protobuf-nanopb-static)
+ protobuf_generate_all(TGT "se-proxy" NAMESPACE "protobuf" BASE_DIR "${TS_ROOT}/protocols")
+endif()
#################################################################
-
-target_include_directories(se-proxy PRIVATE
- ${TS_ROOT}
- ${TS_ROOT}/components
-)