Krolyxon
Commit 3cf4fc5

Branches

Refs →

nsxiv3cf4fc5

Fix broken ci and enable higher level optimization (#220)

* [ci] fix broken ci

* [ci] enable higher optimization level and lto

higher optimization levels enable more warnings and deeper analysis.
likewise, lto can catch a couple errors which typically goes unnoticed
without it.
Author
N-R-K
Date
2022-02-20 07:55 +0000
Committer
GitHub · 2022-02-20 13:55 +0600
Parent
79556e9
Commit
3cf4fc5e816cdda1ae2108987b9558ea6968b9e9

+6 −0

1 file changed

  1. M .github/workflows/build.yml +6 −0
M .github/workflows/build.yml View
@@ -14,6 +14,7 @@ jobs:
1414 - uses: actions/checkout@v2
1515 - name: dep
1616 run: |
17+ sudo apt-get update
1718 sudo apt-get install libimlib2 libimlib2-dev xserver-xorg-core xserver-xorg-dev \
1819 libxft2 libxft-dev libexif12 libexif-dev \
1920 gcc clang
@@ -25,12 +26,14 @@ jobs:
2526 # vanilla flags
2627 CFLAGS="-std=c99 -Wall -pedantic"
2728 # extra flags
29+ CFLAGS+=" -O3 -flto"
2830 CFLAGS+=" -Werror -Wextra -Wshadow -Wvla -Wpointer-arith -Wstrict-prototypes"
2931 CFLAGS+=" -Wundef -Wstrict-overflow=4 -Wwrite-strings -Wunreachable-code"
3032 CFLAGS+=" -Wbad-function-cast -Wdeclaration-after-statement"
3133 # silence
3234 CFLAGS+=" -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers"
3335 export CFLAGS
36+ export LDFLAGS="$CFLAGS"
3437 export OPT_DEP_DEFAULT=1
3538 echo "### GCC BUILD ###" && make clean && CC=gcc make -s
3639 echo "### CLANG BUILD ###" && make clean && CC=clang make -s
@@ -42,6 +45,7 @@ jobs:
4245 - uses: actions/checkout@v2
4346 - name: dep
4447 run: |
48+ sudo apt-get update
4549 sudo apt-get install libimlib2 libimlib2-dev xserver-xorg-core xserver-xorg-dev \
4650 gcc clang
4751 sudo apt-get remove libxft2 libxft-dev libexif12 libexif-dev
@@ -53,12 +57,14 @@ jobs:
5357 # vanilla flags
5458 CFLAGS="-std=c99 -Wall -pedantic"
5559 # extra flags
60+ CFLAGS+=" -O3 -flto"
5661 CFLAGS+=" -Werror -Wextra -Wshadow -Wvla -Wpointer-arith -Wstrict-prototypes"
5762 CFLAGS+=" -Wundef -Wstrict-overflow=4 -Wwrite-strings -Wunreachable-code"
5863 CFLAGS+=" -Wbad-function-cast -Wdeclaration-after-statement"
5964 # silence
6065 CFLAGS+=" -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers"
6166 export CFLAGS
67+ export LDFLAGS="$CFLAGS"
6268 export OPT_DEP_DEFAULT=0
6369 echo "### GCC BUILD ###" && make clean && CC=gcc make -s
6470 echo "### CLANG BUILD ###" && make clean && CC=clang make -s