aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt3
-rw-r--r--app/CMakeLists.txt15
-rw-r--r--secure_fw/CMakeLists.txt13
3 files changed, 15 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1b6d722a85..4dd21e692b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2017, Arm Limited. All rights reserved.
+# Copyright (c) 2017-2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -10,6 +10,7 @@ cmake_minimum_required(VERSION 3.7)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include("Common/BuildSys")
+add_subdirectory(secure_fw)
add_subdirectory(app)
add_subdirectory(bl2/ext/mcuboot)
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
index 54e25a66f9..b4084bb385 100644
--- a/app/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -303,8 +303,16 @@ function(set_up_app_build)
#Ensure secure_fw is built before our executable.
add_dependencies(${EXE_NAME} ${S_BIN})
+ if (NOT DEFINED S_VENEER_PATH)
+ if (EXISTS ${CMAKE_CURRENT_BINARY_DIR}/../secure_fw)
+ set (S_VENEER_PATH "${CMAKE_CURRENT_BINARY_DIR}/../secure_fw")
+ else()
+ message(FATAL_ERROR "No valid path for S_VENEER_PATH, secure_fw is built?")
+ endif()
+ endif()
+
#Add the veneers to the executable.
- set(S_VENEER_FILE "${CMAKE_CURRENT_BINARY_DIR}/${VENEER_NAME}")
+ set(S_VENEER_FILE "${S_VENEER_PATH}/${VENEER_NAME}")
set_property(TARGET ${EXE_NAME} APPEND PROPERTY LINK_LIBRARIES ${S_VENEER_FILE})
#Collect executables to common location: build/install/outputs/
@@ -317,11 +325,6 @@ function(set_up_app_build)
DESTINATION outputs/fvp/)
endfunction()
-if (NOT TARGET_TFM_S_EXISTED)
- set(S_VENEER_FILE_LOCATION "${CMAKE_CURRENT_BINARY_DIR}")
- add_subdirectory(../secure_fw ${CMAKE_CURRENT_BINARY_DIR}/secure_fw)
-endif()
-
if (LINK_TO_BOTH_MEMORY_REGION)
#Link to primary memory region
set_up_app_build(NS_TARGET ${PROJECT_NAME}
diff --git a/secure_fw/CMakeLists.txt b/secure_fw/CMakeLists.txt
index 63a8ba3a13..1fe005ade0 100644
--- a/secure_fw/CMakeLists.txt
+++ b/secure_fw/CMakeLists.txt
@@ -143,15 +143,11 @@ function(set_up_secure_fw_build)
#Set common linker flags
config_setting_shared_linker_flags(${EXE_NAME})
- #Indicates to secure target(s) already created
- set(TARGET_TFM_S_EXISTED True PARENT_SCOPE)
-
#Set individual linker flags per linker target/executable
foreach(flag ${_MY_PARAMS_LINK_DEFINES})
embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "${flag}")
endforeach(flag)
-
embedded_set_target_linker_file(TARGET ${EXE_NAME} PATH "${S_SCATTER_FILE_NAME}")
add_dependencies(${EXE_NAME} tfm_crypto)
@@ -273,11 +269,7 @@ function(set_up_secure_fw_build)
compiler_generate_binary_output(${EXE_NAME})
#Configure where we put the CMSE veneers generated by the compiler.
- if (DEFINED S_VENEER_FILE_LOCATION)
- set(S_VENEER_FILE "${S_VENEER_FILE_LOCATION}/${VENEER_NAME}")
- else()
- set(S_VENEER_FILE "${CMAKE_CURRENT_BINARY_DIR}/${VENEER_NAME}")
- endif()
+ set(S_VENEER_FILE "${CMAKE_CURRENT_BINARY_DIR}/${VENEER_NAME}")
compiler_set_cmse_output(${EXE_NAME} "${S_VENEER_FILE}")
#Configure what file shall be installed.
@@ -386,6 +378,9 @@ if (TFM_PARTITION_AUDIT_LOG)
add_subdirectory(${SECURE_FW_DIR}/services/audit_logging)
endif()
+#Broadcast veneer path in bundled building case
+set(S_VENEER_PATH "${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "")
+
if (LINK_TO_BOTH_MEMORY_REGION)
#Link to primary memory region
set_up_secure_fw_build(S_TARGET ${PROJECT_NAME}