Build: Make cc312 support libraries INTERFACE type
To resolve an accidental link between secure bl2, by duplicating the
libraries for each target.
Change-Id: I9e5103d1ac95d95ed6fd03b477084e216b8ea316
Signed-off-by: Raef Coles <raef.coles@arm.com>
diff --git a/lib/ext/cryptocell-312-runtime/CMakeLists.txt b/lib/ext/cryptocell-312-runtime/CMakeLists.txt
index 18f1c70..4fc0fd7 100644
--- a/lib/ext/cryptocell-312-runtime/CMakeLists.txt
+++ b/lib/ext/cryptocell-312-runtime/CMakeLists.txt
@@ -27,10 +27,10 @@
# it. it's still possible to create multiple targets by altering the name
# variable.
if(NOT TARGET ${CC312_PAL_TARGET})
- add_library(${CC312_PAL_TARGET} STATIC EXCLUDE_FROM_ALL)
+ add_library(${CC312_PAL_TARGET} INTERFACE)
endif()
if(NOT TARGET ${CC312_CDMPU_TARGET})
- add_library(${CC312_CDMPU_TARGET} STATIC EXCLUDE_FROM_ALL)
+ add_library(${CC312_CDMPU_TARGET} INTERFACE)
endif()
add_subdirectory(codesafe)
@@ -56,25 +56,23 @@
########################## PAL #################################################
target_compile_definitions(${CC312_PAL_TARGET}
- PRIVATE
+ INTERFACE
CC_TRNG_MODE=0
$<$<OR:$<CONFIG:Debug>,$<CONFIG:relwithdebinfo>>:CC_PAL_MAX_LOG_LEVEL=3>
- PUBLIC
CC_IOT
)
########################## CDMPU ###############################################
target_link_libraries(${CC312_CDMPU_TARGET}
- PRIVATE
+ INTERFACE
${CC312_PAL_TARGET}
)
target_compile_definitions(${CC312_CDMPU_TARGET}
- PRIVATE
+ INTERFACE
DLLI_MAX_BUFF_SIZE=0x10000
USE_MBEDTLS_CRYPTOCELL
CC_MNG_MIN_BACKUP_SIZE_IN_BYTES=512
- PUBLIC
CC_IOT
)
diff --git a/lib/ext/cryptocell-312-runtime/codesafe/src/crypto_api/CMakeLists.txt b/lib/ext/cryptocell-312-runtime/codesafe/src/crypto_api/CMakeLists.txt
index a425257..fcb62d2 100644
--- a/lib/ext/cryptocell-312-runtime/codesafe/src/crypto_api/CMakeLists.txt
+++ b/lib/ext/cryptocell-312-runtime/codesafe/src/crypto_api/CMakeLists.txt
@@ -110,7 +110,7 @@
########################## CDMPU ###############################################
target_include_directories(${CC312_CDMPU_TARGET}
- PRIVATE
+ INTERFACE
common
cc3x_sym/driver
cc3x_sym/api
@@ -119,7 +119,7 @@
)
target_sources(${CC312_CDMPU_TARGET}
- PRIVATE
+ INTERFACE
cc3x_sym/api/mbedtls_ccm_internal.c
cc3x_sym/driver/aesccm_driver.c
cc3x_sym/driver/aes_driver.c
diff --git a/lib/ext/cryptocell-312-runtime/codesafe/src/mbedtls_api/CMakeLists.txt b/lib/ext/cryptocell-312-runtime/codesafe/src/mbedtls_api/CMakeLists.txt
index 3486618..c7146ff 100644
--- a/lib/ext/cryptocell-312-runtime/codesafe/src/mbedtls_api/CMakeLists.txt
+++ b/lib/ext/cryptocell-312-runtime/codesafe/src/mbedtls_api/CMakeLists.txt
@@ -34,12 +34,12 @@
)
target_include_directories(${CC312_CDMPU_TARGET}
- PRIVATE
+ INTERFACE
.
)
target_sources(${CC312_CDMPU_TARGET}
- PRIVATE
+ INTERFACE
ccm_alt.c
mbedtls_common.c
)
diff --git a/lib/ext/cryptocell-312-runtime/host/CMakeLists.txt b/lib/ext/cryptocell-312-runtime/host/CMakeLists.txt
index e2959c7..214d8a0 100644
--- a/lib/ext/cryptocell-312-runtime/host/CMakeLists.txt
+++ b/lib/ext/cryptocell-312-runtime/host/CMakeLists.txt
@@ -29,12 +29,12 @@
########################## PAL #################################################
target_include_directories(${CC312_PAL_TARGET}
- PRIVATE
+ INTERFACE
src/hal
)
target_sources(${CC312_PAL_TARGET}
- PRIVATE
+ INTERFACE
src/pal/cc_pal_trng.c
src/pal/no_os/cc_pal_abort_plat.c
src/pal/no_os/cc_pal_apbc.c
@@ -50,14 +50,14 @@
########################## CDMPU ###############################################
target_include_directories(${CC312_CDMPU_TARGET}
- PUBLIC
+ INTERFACE
src/cc3x_productionlib/dmpu
src/cc3x_productionlib/cmpu
src/cc3x_productionlib/common
)
target_sources(${CC312_CDMPU_TARGET}
- PRIVATE
+ INTERFACE
src/cc3x_lib/cc_rng_plat.c
src/cc3x_productionlib/cmpu/cmpu.c
src/cc3x_productionlib/cmpu/cmpu_derivation.c
diff --git a/lib/ext/cryptocell-312-runtime/shared/CMakeLists.txt b/lib/ext/cryptocell-312-runtime/shared/CMakeLists.txt
index c29db13..4435fde 100644
--- a/lib/ext/cryptocell-312-runtime/shared/CMakeLists.txt
+++ b/lib/ext/cryptocell-312-runtime/shared/CMakeLists.txt
@@ -28,17 +28,16 @@
)
target_include_directories(${CC312_PAL_TARGET}
- PRIVATE
+ INTERFACE
include
include/proj/cc3x
hw/include
- PUBLIC
include/pal
include/pal/no_os
)
target_include_directories(${CC312_CDMPU_TARGET}
- PRIVATE
+ INTERFACE
include/crypto_api
include/crypto_api/cc3x
include/cc_mng