Build: Always include preload_ns.cmake if it exists
Rather than using a cmake variable to determine whether to include
preload_ns.cmake, always include it if it exists.
This allows the platforms that currently provide an empty
preload_ns.cmake file to get rid of it.
Change-Id: I7e5755a75133caf7bb3a652a0d4ab2780dc5ae90
Signed-off-by: Chris Brand <chris.brand@cypress.com>
diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt
index 9dae7c8..0062d56 100644
--- a/interface/CMakeLists.txt
+++ b/interface/CMakeLists.txt
@@ -1,5 +1,7 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2020-2022, Arm Limited. All rights reserved.
+# Copyright (c) 2022 Cypress Semiconductor Corporation (an Infineon company)
+# or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -15,9 +17,12 @@
${CMAKE_BINARY_DIR}/generated/interface/include/psa/framework_feature.h
@ONLY)
-if (TFM_MULTI_CORE_TOPOLOGY)
+if (EXISTS ${CMAKE_SOURCE_DIR}/platform/ext/target/${TFM_PLATFORM}/preload_ns.cmake)
include(${CMAKE_SOURCE_DIR}/platform/ext/target/${TFM_PLATFORM}/preload_ns.cmake)
tfm_toolchain_reload_compiler()
+endif()
+
+if (TFM_MULTI_CORE_TOPOLOGY)
# 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)