build: overwrite clang-format version on Ubuntu 24.04 58/41258/1
authorJay Wang <jay.wang2@arm.com>
Fri, 12 Jul 2024 12:53:56 +0000 (12:53 +0000)
committerJay Wang <jay.wang2@arm.com>
Fri, 12 Jul 2024 12:53:56 +0000 (12:53 +0000)
clang-format-11 is used by default in checkstyle.sh while it can be
overridden to higher clang-format version. On Ubuntu 24.04, the minimum
version of clang-format is version 14. Set the environment variable
explicitly in Makefile to overwrite the clang-format version.

Before:
$ make checkstyle
extras/scripts/checkstyle.sh: line 41: --version: command not found
make: *** [Makefile:775: checkstyle] Error 127

After:
$ make checkstyle
Ubuntu clang-format version 14.0.6
*******************************************************************
* CHECKSTYLE SUCCESSFULLY COMPLETED
*******************************************************************

Type: fix

Change-Id: Iba3e4739c9376701577b2f37e070d199b195e7d0
Signed-off-by: Jay Wang <jay.wang2@arm.com>
Makefile

index b69f3e8..baf5b07 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -92,6 +92,8 @@ LIBFFI=libffi6 # works on all but 20.04 and debian-testing
 ifeq ($(OS_VERSION_ID),24.04)
         DEB_DEPENDS += libssl-dev
         DEB_DEPENDS += llvm clang clang-format-14
+       # overwrite clang-format version to run `make checkstyle` successfully
+       export CLANG_FORMAT_VER=14
         LIBFFI=libffi8
         DEB_DEPENDS += enchant-2  # for docs
 else ifeq ($(OS_VERSION_ID),22.04)