Skip to content

Commit

Permalink
update interface cmakelists
Browse files Browse the repository at this point in the history
  • Loading branch information
as-iotex committed Oct 12, 2022
1 parent fb1f53c commit c375acb
Showing 1 changed file with 4 additions and 58 deletions.
62 changes: 4 additions & 58 deletions interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,67 +6,13 @@
#-------------------------------------------------------------------------------

cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0076 NEW)
cmake_policy(SET CMP0079 NEW)

# Generate framework feature
set(PSA_FRAMEWORK_ISOLATION_LEVEL ${TFM_ISOLATION_LEVEL})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/psa/framework_feature.h.in
${CMAKE_BINARY_DIR}/generated/interface/include/psa/framework_feature.h
@ONLY)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src SRCS_INTERFACE)

if (TFM_MULTI_CORE_TOPOLOGY)
include(${CMAKE_SOURCE_DIR}/platform/ext/target/${TFM_PLATFORM}/preload_ns.cmake)
tfm_toolchain_reload_compiler()
# The platform target is created in this directory/file so that it has the
# same settings as the main ns target.
add_library(platform_ns STATIC EXCLUDE_FROM_ALL)
endif()
add_library(iotex_tf_nonsecure ${SRCS_INTERFACE})

###################### PSA interface (header only) #############################

add_library(psa_interface INTERFACE)

target_include_directories(psa_interface
INTERFACE
target_include_directories(iotex_tf_nonsecure
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}/generated/interface/include
$<$<OR:$<BOOL:${FORWARD_PROT_MSG}>,$<BOOL:${TFM_MULTI_CORE_TOPOLOGY}>>:${CMAKE_CURRENT_SOURCE_DIR}/include/multi_core>
)

# PSA interface files are generated from a template
add_dependencies(psa_interface
tfm_generated_files
)

target_link_libraries(psa_interface
INTERFACE
tfm_partition_defs
)

target_compile_definitions(psa_interface
INTERFACE
$<$<BOOL:${TFM_PSA_API}>:TFM_PSA_API>
$<$<BOOL:${CONFIG_TFM_ENABLE_CTX_MGMT}>:CONFIG_TFM_ENABLE_CTX_MGMT>
$<$<BOOL:${TFM_ISOLATION_LEVEL}>:TFM_LVL=${TFM_ISOLATION_LEVEL}>
$<$<BOOL:${TFM_MULTI_CORE_TOPOLOGY}>:TFM_MULTI_CORE_TOPOLOGY>
$<$<BOOL:${FORWARD_PROT_MSG}>:FORWARD_PROT_MSG=${FORWARD_PROT_MSG}>
$<$<BOOL:${CONFIG_TFM_PARTITION_META}>:CONFIG_TFM_PARTITION_META>
$<$<BOOL:${CONFIG_TFM_DOORBELL_API}>:CONFIG_TFM_DOORBELL_API=1>
)

###################### PSA api (S lib) #########################################

target_sources(tfm_secure_api
INTERFACE
$<$<BOOL:${TFM_PSA_API}>:${CMAKE_CURRENT_SOURCE_DIR}/src/tfm_psa_call_pack.c>
)

###################### Export configurations to NS #############################

if (TFM_MULTI_CORE_TOPOLOGY OR FORWARD_PROT_MSG)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/multi_core/tfm_mailbox_config.h.in
${CMAKE_BINARY_DIR}/generated/interface/include/tfm_mailbox_config.h
NEWLINE_STYLE UNIX
)
endif()

0 comments on commit c375acb

Please sign in to comment.