CPP-Check: Use Absolute Path of Toolchain File
Without a specified path, compiler would search for toolchain file in
trusted-firmware/build-cppcheck/, which is not the correct path.
Absolute path could fix the error of unable to find toolchain file.
Change-Id: I7f1c5540762fcb1862f1152351ed81cd7477c560
Signed-off-by: Xinyu Zhang <xinyu.zhang@arm.com>
diff --git a/run-cppcheck.sh b/run-cppcheck.sh
index 66de5e7..2bb31e9 100755
--- a/run-cppcheck.sh
+++ b/run-cppcheck.sh
@@ -72,6 +72,7 @@
#Library file for cppcheck
library_file="$(fix_win_path $(get_full_path $mypath))/cppcheck/arm-cortex-m.cfg"
suppress_file="$(fix_win_path $(get_full_path $mypath))/cppcheck/tfm-suppress-list.txt"
+toolchain_file="$(fix_win_path $(get_full_path ./))/toolchain_GNUARM.cmake"
#Enable all additional checks by default
additional_checklist="all"
@@ -80,8 +81,7 @@
echo
echo '******* Generating compile_commands.json ***************'
echo
-generate_project $(fix_win_path $(get_full_path ./)) "./" "cppcheck" "-DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DTFM_PLATFORM=mps2/an521 -DTFM_TOOLCHAIN_FILE=toolchain_GNUARM.cmake"
-
+generate_project $(fix_win_path $(get_full_path ./)) "./" "cppcheck" "-DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DTFM_PLATFORM=mps2/an521 -DTFM_TOOLCHAIN_FILE=$toolchain_file"
#Enter the build directory
bdir=$(make_build_dir_name "./" "cppcheck")
pushd "$bdir" >/dev/null