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.
Change-Id: I7c9f4a6d51cc256d2b482c13ecc269b94eb228ac
Signed-off-by: Chris Brand <chris.brand@cypress.com>
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
index c15c12f..cb917a4 100755
--- a/app/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -1,6 +1,7 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2020-2022, Arm Limited. All rights reserved.
-# Copyright (c) 2022, Cypress Semiconductor Corp. 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
#
@@ -13,10 +14,12 @@
# Secure code. To facilitate this, we once again reload the compiler to load the
# setting for the NS CPU. Cmake settings are directory scoped so this affects
# anything loaded from or declared in this dir.
-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)
# Enable TFM_MULTI_CORE_NS_OS when building with tf-m-tests NS App.
set(TFM_MULTI_CORE_NS_OS ON CACHE BOOL "Enable NS RTOS support in NS mailbox")
endif()