Parse dependency versions from TF-M CMake
To make sure CI totally aligned with TF-M, it is better to automatically
parse dependency versions by CI instead of passing a fixed version via
Jenkins environment variable.
This patch adds the logic to select dependency version specified in TF-M
CMake system by default. And CI user can also manually change the
dependency version by setting the corresponding Jenkins environment
variable when triggerring CI jobs.
For the dependency version which differs from platforms, for example
tf-m-extras, the version is double checked with the value in CMake Cache
in each single build-config job.
Signed-off-by: Xinyu Zhang <xinyu.zhang@arm.com>
Change-Id: Ia528783f4235786530c7f25785facae93534c1d3
diff --git a/util_cmake.sh b/util_cmake.sh
index 8895123..00b91c9 100755
--- a/util_cmake.sh
+++ b/util_cmake.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#-------------------------------------------------------------------------------
-# Copyright (c) 2018-2019, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2018-2023, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -297,3 +297,18 @@
done
return $error
}
+
+# Get CMake variable value from cache
+function get_cmake_cache {
+ local build_dir=$1
+ local cmake_var=$2
+
+ if [ ! -d ${REPO_PATH} ]; then
+ return
+ fi
+
+ cd $build_dir
+ cache_value="$(cmake -L 2> /dev/null | grep $cmake_var | awk -F '=' '{print $2}')"
+ echo $cache_value
+ cd $OLDPWD
+}