Skip to content

Commit

Permalink
Merge pull request #777 from zeux/werror
Browse files Browse the repository at this point in the history
Use -Werror in Makefile builds in CI only
  • Loading branch information
zeux authored Sep 30, 2024
2 parents 897976b + fe64440 commit ae51b3f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
os: [{ name: ubuntu, version: ubuntu-latest }, { name: macos-intel, version: macos-13 }, { name: macos-arm, version: macos-14 }]
name: ${{matrix.os.name}}
runs-on: ${{matrix.os.version}}
env:
werror: 1
steps:
- uses: actions/checkout@v4
- name: work around ASLR+ASAN compatibility
Expand Down Expand Up @@ -131,6 +133,8 @@ jobs:
gltfpack-basis:
runs-on: ubuntu-latest
env:
werror: 1
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
Expand Down
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ OBJECTS=$(LIBRARY_OBJECTS) $(DEMO_OBJECTS) $(GLTFPACK_OBJECTS)
LIBRARY=$(BUILD)/libmeshoptimizer.a
DEMO=$(BUILD)/meshoptimizer

CFLAGS=-g -Wall -Wextra -Werror -std=c89
CXXFLAGS=-g -Wall -Wextra -Wshadow -Wno-missing-field-initializers -Werror -std=gnu++98
CFLAGS=-g -Wall -Wextra -std=c89
CXXFLAGS=-g -Wall -Wextra -Wshadow -Wno-missing-field-initializers -std=gnu++98
LDFLAGS=

$(GLTFPACK_OBJECTS): CXXFLAGS+=-std=c++11
Expand Down Expand Up @@ -63,6 +63,11 @@ WASM_SIMPLIFIER_EXPORTS=meshopt_simplify meshopt_simplifyWithAttributes meshopt_
WASM_CLUSTERIZER_SOURCES=src/clusterizer.cpp tools/wasmstubs.cpp
WASM_CLUSTERIZER_EXPORTS=meshopt_buildMeshletsBound meshopt_buildMeshlets meshopt_computeClusterBounds meshopt_computeMeshletBounds meshopt_optimizeMeshlet sbrk __wasm_call_ctors

ifneq ($(werror),)
CFLAGS+=-Werror
CXXFLAGS+=-Werror
endif

ifeq ($(config),iphone)
IPHONESDK=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
CFLAGS+=-arch armv7 -arch arm64 -isysroot $(IPHONESDK)
Expand Down Expand Up @@ -145,7 +150,7 @@ $(BUILD)/gltfpack: $(GLTFPACK_OBJECTS) $(LIBRARY)
gltfpack.wasm: gltf/library.wasm

gltf/library.wasm: $(LIBRARY_SOURCES) $(GLTFPACK_SOURCES)
$(WASMCC) $^ -o $@ -Os -DNDEBUG --target=wasm32-wasi --sysroot=$(WASIROOT) -nostartfiles -Wl,--no-entry -Wl,--export=pack -Wl,--export=malloc -Wl,--export=free -Wl,--export=__wasm_call_ctors -Wl,-s -Wl,--allow-undefined-file=gltf/wasistubs.txt
$(WASMCC) $^ -o $@ -Wall -Os -DNDEBUG --target=wasm32-wasi --sysroot=$(WASIROOT) -nostartfiles -Wl,--no-entry -Wl,--export=pack -Wl,--export=malloc -Wl,--export=free -Wl,--export=__wasm_call_ctors -Wl,-s -Wl,--allow-undefined-file=gltf/wasistubs.txt

build/decoder_base.wasm: $(WASM_DECODER_SOURCES)
@mkdir -p build
Expand Down

0 comments on commit ae51b3f

Please sign in to comment.