summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorN-R-K <79544946+N-R-K@users.noreply.github.com>2022-02-20 08:55:17 +0100
committerGitHub <noreply@github.com>2022-02-20 08:55:17 +0100
commit3cf4fc5e816cdda1ae2108987b9558ea6968b9e9 (patch)
tree659365328c907f8f9b51909ec4d50c02af730f59
parent79556e9b02c399eff9a684463847f1c63d3322a1 (diff)
downloadnsxiv-3cf4fc5e816cdda1ae2108987b9558ea6968b9e9.tar.zst
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.
-rw-r--r--.github/workflows/build.yml6
1 files changed, 6 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 67cd347..e675de2 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -14,6 +14,7 @@ jobs:
- uses: actions/checkout@v2
- name: dep
run: |
+ sudo apt-get update
sudo apt-get install libimlib2 libimlib2-dev xserver-xorg-core xserver-xorg-dev \
libxft2 libxft-dev libexif12 libexif-dev \
gcc clang
@@ -25,12 +26,14 @@ jobs:
# vanilla flags
CFLAGS="-std=c99 -Wall -pedantic"
# extra flags
+ CFLAGS+=" -O3 -flto"
CFLAGS+=" -Werror -Wextra -Wshadow -Wvla -Wpointer-arith -Wstrict-prototypes"
CFLAGS+=" -Wundef -Wstrict-overflow=4 -Wwrite-strings -Wunreachable-code"
CFLAGS+=" -Wbad-function-cast -Wdeclaration-after-statement"
# silence
CFLAGS+=" -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers"
export CFLAGS
+ export LDFLAGS="$CFLAGS"
export OPT_DEP_DEFAULT=1
echo "### GCC BUILD ###" && make clean && CC=gcc make -s
echo "### CLANG BUILD ###" && make clean && CC=clang make -s
@@ -42,6 +45,7 @@ jobs:
- uses: actions/checkout@v2
- name: dep
run: |
+ sudo apt-get update
sudo apt-get install libimlib2 libimlib2-dev xserver-xorg-core xserver-xorg-dev \
gcc clang
sudo apt-get remove libxft2 libxft-dev libexif12 libexif-dev
@@ -53,12 +57,14 @@ jobs:
# vanilla flags
CFLAGS="-std=c99 -Wall -pedantic"
# extra flags
+ CFLAGS+=" -O3 -flto"
CFLAGS+=" -Werror -Wextra -Wshadow -Wvla -Wpointer-arith -Wstrict-prototypes"
CFLAGS+=" -Wundef -Wstrict-overflow=4 -Wwrite-strings -Wunreachable-code"
CFLAGS+=" -Wbad-function-cast -Wdeclaration-after-statement"
# silence
CFLAGS+=" -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers"
export CFLAGS
+ export LDFLAGS="$CFLAGS"
export OPT_DEP_DEFAULT=0
echo "### GCC BUILD ###" && make clean && CC=gcc make -s
echo "### CLANG BUILD ###" && make clean && CC=clang make -s