Merge pull request #2530 from jamessan/Werror-only-ci

Remove -Werror from default CFLAGS
This commit is contained in:
Amaan Qureshi 2023-08-18 17:21:48 -04:00 committed by GitHub
commit ab09ae20d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View file

@ -177,6 +177,7 @@ jobs:
TARGET: ${{ matrix.target }}
CC: ${{ matrix.cc }}
AR: ${{ matrix.ar }}
IS_WINDOWS: ${{ contains(matrix.os, 'windows') }}
run: |
PATH="$PWD/.github/scripts:$PATH"
echo "$PWD/.github/scripts" >> $GITHUB_PATH
@ -191,6 +192,8 @@ jobs:
[ -n "$CC" ] && echo "CC=$CC" >> $GITHUB_ENV
[ -n "$AR" ] && echo "AR=$AR" >> $GITHUB_ENV
[ "$IS_WINDOWS" = "false" ] && echo "CFLAGS=-Werror" >> $GITHUB_ENV
if [ "$USE_CROSS" == "true" ]; then
echo "BUILD_CMD=cross" >> $GITHUB_ENV
runner=$(BUILD_CMD=cross cross.sh bash -c "env | sed -nr '/^CARGO_TARGET_.*_RUNNER=/s///p'")
@ -199,7 +202,7 @@ jobs:
- name: Build C library
if: ${{ !contains(matrix.os, 'windows') }} # Requires an additional adapted Makefile for `cl.exe` compiler
run: make.sh CFLAGS="-Werror" -j
run: make.sh -j
- name: Build wasm library
if: ${{ !matrix.cli-only && !matrix.use-cross }} # No sense to build on the same Github runner hosts many times

View file

@ -18,7 +18,7 @@ endif
OBJ := $(SRC:.c=.o)
# define default flags, and override to append mandatory flags
override CFLAGS := -O3 -std=gnu99 -fPIC -fvisibility=hidden -Wall -Wextra -Werror -Wshadow $(CFLAGS)
override CFLAGS := -O3 -std=gnu99 -fPIC -fvisibility=hidden -Wall -Wextra -Wshadow $(CFLAGS)
override CFLAGS += -Ilib/src -Ilib/include
# ABI versioning

View file

@ -28,7 +28,6 @@ fn main() {
.flag_if_supported("-std=c99")
.flag_if_supported("-fvisibility=hidden")
.flag_if_supported("-Wshadow")
.flag_if_supported("-Werror")
.include(src_path)
.include("include")
.file(src_path.join("lib.c"))