CodeCoverage: Add CODE_COVERAGE_EN flag in build

Add CODE_COVERAGE_EN for Cmake command to TF-M when build with code
coverage feature required.

Signed-off-by: Karl Zhang <karl.zhang@arm.com>
Change-Id: I5715440a364dae239d3442006566c4036944629b
diff --git a/run-build.sh b/run-build.sh
index a7f84f2..219df37 100755
--- a/run-build.sh
+++ b/run-build.sh
@@ -34,6 +34,12 @@
 set -ex
 build_commands=$(python3 tf-m-ci-scripts/configs.py -b -g all $CONFIG_NAME)
 
+if [ $CODE_COVERAGE_EN = "TRUE" ] && [[ $CONFIG_NAME =~ "GNUARM" ]] ; then
+    build_commands=${build_commands/-DCOMPILER=GNUARM/-DCOMPILER=GNUARM -DCODE_COVERAGE_EN=TRUE}
+    echo "Flag: Add compiler flag for build with code coverage supported."
+    echo $build_commands
+fi
+
 if [ -z "$build_commands" ] ; then
 	echo "No build commands found."
 	exit 1