Skip to content

Commit

Permalink
CI: add more build warning checks and force them to error.
Browse files Browse the repository at this point in the history
Add CMAKE_C_FLAGS warnings to highlight potential issue:
"-Wall -Wextra -Wshadow -Wunused-but-set-variable"
And force warning as error with "-Werror"

Signed-off-by: Arnaud Pouliquen <[email protected]>
  • Loading branch information
arnopo committed Nov 28, 2022
1 parent 3586171 commit 081172c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/actions/build_ci/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@ build_linux(){
pwd || exit 1
ls -l || exit 1
cd libmetal || exit 1
cmake . -Bbuild || exit 1
cmake . -Bbuild \
-DCMAKE_C_FLAGS="-Werror -Wall -Wextra -Wshadow -Wunused-but-set-variable" || exit 1
cd build || exit 1
make || exit 1
export || exit 1
cd ../.. || exit 1
cmake . -Bbuild -DWITH_APPS=on -DWITH_PROXY=on -DCMAKE_INCLUDE_PATH="./libmetal/build/lib/include" -DCMAKE_LIBRARY_PATH="./libmetal/build/lib" || exit 1
cmake . -Bbuild -DCMAKE_C_FLAGS="-Werror -Wall -Wextra -Wshadow -Wunused-but-set-variable" \
-DWITH_APPS=on -DWITH_PROXY=on -DCMAKE_INCLUDE_PATH="./libmetal/build/lib/include" \
-DCMAKE_LIBRARY_PATH="./libmetal/build/lib" || exit 1
cd build || exit 1
make VERBOSE=1 all || exit 1
exit 0
Expand All @@ -43,11 +46,16 @@ build_generic(){
echo " Build for generic platform "
apt-get install -y gcc-arm-none-eabi || exit 1
cd libmetal || exit 1
cmake . -Bbuild-generic -DCMAKE_TOOLCHAIN_FILE=template-generic || exit 1
cmake . -Bbuild-generic -DCMAKE_TOOLCHAIN_FILE=template-generic \
-DCMAKE_C_FLAGS="-Werror -Wall -Wextra -Wshadow -Wunused-but-set-variable" || exit 1
cd build-generic || exit 1
make VERBOSE=1 || exit 1
cd ../../ || exit 1
cmake . -Bbuild-generic -DCMAKE_TRY_COMPILE_TARGET_TYPE="STATIC_LIBRARY" -DCMAKE_C_FLAGS="" -DCMAKE_SYSTEM_PROCESSOR="arm" -DCMAKE_C_COMPILER=arm-none-eabi-gcc -DCMAKE_INCLUDE_PATH="./libmetal/build-generic/lib/include" -DCMAKE_LIBRARY_PATH="./libmetal/build-generic/lib" || exit 1
cmake . -Bbuild-generic -DCMAKE_TRY_COMPILE_TARGET_TYPE="STATIC_LIBRARY" \
-DCMAKE_C_FLAGS="-Werror -Wall -Wextra -Wshadow -Wunused-but-set-variable" \
-DCMAKE_SYSTEM_PROCESSOR="arm" -DCMAKE_C_COMPILER=arm-none-eabi-gcc \
-DCMAKE_INCLUDE_PATH="./libmetal/build-generic/lib/include" \
-DCMAKE_LIBRARY_PATH="./libmetal/build-generic/lib" || exit 1
cd build-generic || exit 1
make VERBOSE=1 || exit 1
exit 0
Expand Down

0 comments on commit 081172c

Please sign in to comment.