Skip to content

Commit 1ac440c

Browse files
committed
CMake/Github action: Modernize
1 parent a024db0 commit 1ac440c

2 files changed

Lines changed: 12 additions & 28 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,51 +23,33 @@ jobs:
2323
build_type: [Dev]
2424
cpp_compiler: [g++]
2525
include:
26-
- image: "ubuntu:22.04"
27-
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds
28-
- image: "ubuntu:24.04"
29-
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds
30-
- image: "debian:bookworm"
31-
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds
3226
- image: "debian:bookworm"
3327
c_compiler: clang
3428
cpp_compiler: clang++
35-
- image: "debian:bookworm"
36-
build_type: RelWithDebInfo
37-
- image: "debian:trixie"
38-
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds
3929
- image: "debian:trixie"
4030
c_compiler: clang
4131
cpp_compiler: clang++
4232
- image: "debian:trixie"
4333
build_type: RelWithDebInfo
44-
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds
45-
- image: "debian:testing"
46-
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds -Wno-maybe-uninitialized
34+
- image: "debian:trixie"
35+
c_compiler: clang
36+
cpp_compiler: clang++
37+
CXXFLAGS: -fsanitize=address,undefined -fno-sanitize-recover=all -fno-omit-frame-pointer
38+
LDFLAGS: -fsanitize=address,undefined
4739
- image: "debian:testing"
4840
c_compiler: clang
4941
cpp_compiler: clang++
50-
- image: "debian:experimental"
51-
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds -Wno-maybe-uninitialized
5242
- image: "debian:experimental"
5343
c_compiler: clang
5444
cpp_compiler: clang++
55-
- image: "fedora:40"
56-
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds
57-
- image: "fedora:41"
58-
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds
59-
- image: "fedora:42"
60-
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds -Wno-maybe-uninitialized
61-
- image: "fedora:43"
62-
CXXFLAGS: -Wno-stringop-overread -Wno-array-bounds -Wno-maybe-uninitialized
6345
container:
6446
image: ${{ matrix.image }}
6547
env:
6648
LANG: en_US.UTF-8
6749
BUILD_TYPE: ${{ matrix.build_type }}
6850
CC: ${{ matrix.c_compiler }}
6951
CXX: ${{ matrix.cpp_compiler }}
70-
CXXFLAGS: ${{ matrix.CXXFLAGS }}
52+
CXXFLAGS: -Werror ${{ matrix.CXXFLAGS }}
7153
LDFLAGS: ${{ matrix.LDFLAGS }}
7254
APT_LISTCHANGES_FRONTEND: none
7355
DEBIAN_FRONTEND: noninteractive
@@ -90,10 +72,6 @@ jobs:
9072
libsqlite3-dev \
9173
make \
9274
zlib1g-dev
93-
- name: Install compiler
94-
shell: bash
95-
if: matrix.cpp_compiler == 'clang++-14'
96-
run: apt-get install -yq clang-14
9775
- name: Prepare container (dnf)
9876
shell: bash
9977
if: startsWith(matrix.image, 'fedora:')
@@ -122,6 +100,7 @@ jobs:
122100
env:
123101
CC: clang-18
124102
CXX: clang++-18
103+
CXXFLAGS: -Werror
125104
BUILD_TYPE: Dev
126105
steps:
127106
- uses: actions/checkout@v4
@@ -147,6 +126,7 @@ jobs:
147126
env:
148127
CC: clang
149128
CXX: clang++
129+
CXXFLAGS: -Werror
150130
BUILD_TYPE: ${{ matrix.build_type }}
151131
steps:
152132
- uses: actions/checkout@v4

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ if(CMAKE_BUILD_TYPE STREQUAL "Dev")
7171
add_definitions(${OSMIUM_WARNING_OPTIONS})
7272
endif()
7373

74+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
75+
add_definitions(-Wno-stringop-overread)
76+
endif()
77+
7478
# Force RelWithDebInfo build type if none was given
7579
if(CMAKE_BUILD_TYPE)
7680
set(build_type ${CMAKE_BUILD_TYPE})

0 commit comments

Comments
 (0)