Tests: The "split build" adaptation
This code builds TEST_NS_ITS test using split build.
cd ./trusted-firmware-m
cmake -S . -B ../tf-m-tests/build-tfm -DTFM_PLATFORM=arm/mps2/an521
-DCONFIG_TFM_BUILD_SPLIT=ON
-DCMAKE_INSTALL_PREFIX=../tf-m-tests/build-tfm/api_ns
-DTFM_TOOLCHAINE=toolchain_GNUARM.cmake
-DTFM_PROFILE=profile_small
-DNS=OFF -DTEST_S=OFF -DPLATFORM_DEFAULT_IMAGE_SIGNING=ON
cmake --build build -- install
cd ../tf-m-tests/app_ns_test
cmake -S . -B build -DTEST_NS_ITS=OFF
-DCONFIG_SPE_PATH=../build-tfm/api_ns
cmake --build build -- tfm_app_binaries
Check the binary in ./build/tfm_s_ns_signed.bin
Signed-off-by: Anton Komlev <anton.komlev@arm.com>
Change-Id: Icaf38d844fe38d444b973776af2616d16c5439b1
diff --git a/cmake/utils.cmake b/cmake/utils.cmake
new file mode 100644
index 0000000..2717293
--- /dev/null
+++ b/cmake/utils.cmake
@@ -0,0 +1,56 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2022, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+# A string calibrating routine to the specified length by
+# appending to an input string a specified character.
+#
+# output - variable to return the calibrated string
+
+function(format_string output input size filler)
+ string(LENGTH ${input} length)
+ foreach(i RANGE ${length} ${size})
+ string(CONCAT input ${input} ${filler})
+ endforeach()
+ set(${output} ${input} PARENT_SCOPE)
+endfunction()
+
+# Prints formatted list of options with a title
+#
+# title - will be printed in a header
+# options - list of CMake options to print (semicolon separated)
+#
+# Example:
+# dump_options("Partitions" "TFM_PARTITION_CRYPTO; TFM_PARTITION_FIRMWARE_UPDATE ")
+# will produce:
+# -- -------- Partitions ---------------------
+# -- TFM_PARTITION_CRYPTO ON
+# -- TFM_PARTITION_FIRMWARE_UPDATE OFF
+# -- -----------------------------------------
+
+function(dump_options title options)
+
+ if (CONFIG_TFM_PARTITION_QUIET)
+ return()
+ endif()
+
+ format_string(header "-------- ${title} " 50 "-")
+ message(STATUS )
+ message(STATUS "${header}")
+
+ foreach (option ${options})
+ string(STRIP ${option} option)
+ # avoid errors on empty strings to tolerate ';' at the end of list
+ if((DEFINED ${option}) AND NOT ${option} STREQUAL "")
+ format_string(option_name ${option} 40 " ")
+ message(STATUS "${option_name} ${${option}}")
+ endif()
+ endforeach()
+
+ format_string(footer "-" 50 "-")
+ message(STATUS "${footer}")
+endfunction()
+