Skip to content

Commit

Permalink
Add -DNDEBUG -ftree-vectorize -mtune=generic compiler flags.
Browse files Browse the repository at this point in the history
  • Loading branch information
petur committed Nov 28, 2024
1 parent 794016e commit 9efbd6d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/make.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,28 @@ jobs:
cxx: g++
llvm_profdata: ''
arch: nehalem
extra: ''
- runner: ubuntu-latest
shell: 'bash'
suffix: -linux-gcc
cxx: g++
llvm_profdata: ''
arch: haswell
extra: ''
- runner: ubuntu-22.04
shell: 'bash'
suffix: -linux-clang
cxx: clang++-14
llvm_profdata: llvm-profdata-14
arch: haswell
extra: '-DNDEBUG'
- runner: windows-latest
shell: 'msys2 {0}'
suffix: -windows-clang
cxx: clang++
llvm_profdata: llvm-profdata
arch: haswell
extra: '-DNDEBUG'
defaults:
run:
shell: ${{ matrix.platform.shell }}
Expand All @@ -50,7 +54,8 @@ jobs:
- id: make
run: |
make CXX=${{ matrix.platform.cxx }} LLVM_PROFDATA=${{ matrix.platform.llvm_profdata }} \
ARCH=${{ matrix.platform.arch }} LDFLAGS='-static -s' SUFFIX=${{ matrix.platform.suffix }}
ARCH=${{ matrix.platform.arch }} EXTRA_CPPFLAGS='${{ matrix.platform.extra }}' \
LDFLAGS='-static -s' SUFFIX=${{ matrix.platform.suffix }}
echo "artifact=$(basename -s .exe out/seawall-*)" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ifeq ($(ARCH),)
ARCH := native
endif
RTTIFLAGS = -fno-rtti -fno-exceptions
CXXFLAGS += -Wall -Wextra -Werror -std=c++17 -Ofast -march=$(ARCH) -mtune=$(ARCH) -flto $(RTTIFLAGS) $(PGOFLAGS)
CXXFLAGS += -Wall -Wextra -Werror -std=c++17 -Ofast -ftree-vectorize -march=$(ARCH) -mtune=generic -flto $(RTTIFLAGS) $(PGOFLAGS)

version := 20240926
ifeq ($(version),)
Expand All @@ -22,7 +22,7 @@ endif
endif

release := out/seawall-$(version)$(SUFFIX)
CPPFLAGS += -DSEAWALL_VERSION=$(version)
CPPFLAGS += -DSEAWALL_VERSION=$(version) $(EXTRA_CPPFLAGS)

ifeq ($(LLVM_PROFDATA),)
LLVM_PROFDATA=llvm-profdata
Expand Down

0 comments on commit 9efbd6d

Please sign in to comment.