Skip to content

Commit 7e635ac

Browse files
committed
✨👷‍♀️ CMakePresets for tests, self-generated inclusion tests
1 parent 440ebbb commit 7e635ac

28 files changed

Lines changed: 776 additions & 751 deletions

.github/workflows/macosx.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Push & Pull Request Continuous Integration
2+
on:
3+
pull_request:
4+
types: [synchronize, opened, edited]
5+
push:
6+
7+
env:
8+
CTEST_OUTPUT_ON_FAILURE: 1
9+
10+
jobs:
11+
ci:
12+
name: "${{matrix.os}} ${{matrix.compiler}} c${{matrix.c_standard}} c++${{matrix.cxx_standard}}"
13+
strategy:
14+
matrix:
15+
os:
16+
- ubuntu
17+
- windows
18+
- macos
19+
compiler:
20+
- msvc
21+
- gcc
22+
- clang
23+
c_standard:
24+
- 17
25+
- 23
26+
cxx_standard:
27+
- 20
28+
- 23
29+
- 26
30+
exclude:
31+
- compiler: msvc
32+
os: ubuntu
33+
- compiler: msvc
34+
os: macos
35+
runs-on: ${{matrix.os}}-latest
36+
env:
37+
CMAKE_CXX_STANDARD: ${{matrix.cxx_standard}}
38+
CMAKE_C_STANDARD: ${{matrix.c_standard}}
39+
steps:
40+
# important setup
41+
- uses: actions/checkout@main
42+
with:
43+
submodules: recursive
44+
- uses: humbletim/vsdevenv-shell@main
45+
if: ${{matrix.os == 'windows'}}
46+
- uses: seanmiddleditch/gha-setup-ninja@master
47+
if: ${{matrix.os == 'windows'}}
48+
# actual runs
49+
- name: Execute CMake Workflow (Windows)
50+
if: ${{(matrix.os == 'windows' && matrix.compiler == 'msvc')}}
51+
shell: vsdevenv x64 powershell {0}
52+
run: cmake --workflow --preset ${{matrix.compiler}}
53+
- name: Execute CMake Workflow (Non-Windows)
54+
if: ${{(matrix.os != 'windows' || matrix.compiler != 'msvc')}}
55+
run: cmake --workflow --preset ${{matrix.compiler}}

.github/workflows/ubuntu.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/windows.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

CMakeLists.txt

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#
2929
# ============================================================================ #
3030

31-
cmake_minimum_required(VERSION 3.28.0)
31+
cmake_minimum_required(VERSION 3.31.0)
3232

3333
# # Project kickstart
3434
# Includes a bunch of basic flags and utilities shared across projects
@@ -111,17 +111,6 @@ if(ZTD_ENCODING_TABLES_IS_TOP_LEVEL_PROJECT)
111111
check_compiler_diagnostic(microsoft-enum-value)
112112
check_compiler_diagnostic(gnu-zero-variadic-macro-arguments)
113113
check_compiler_diagnostic(type-limits)
114-
# (Wstringop-overflow) - [meta-bug] bogus/missing -Wstringop-overflow warnings
115-
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443
116-
# Bogus -Wstringop-overflow warning
117-
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100395
118-
# [10 Regression] spurious -Wstringop-overflow writing to a trailing array plus offset
119-
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95353
120-
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
121-
check_compiler_diagnostic(stringop-overflow)
122-
check_compiler_diagnostic(stringop-overread)
123-
check_compiler_diagnostic(array-bounds)
124-
endif()
125114
endif()
126115
endif()
127116

@@ -177,6 +166,25 @@ if(ZTD_ENCODING_TABLES_IS_TOP_LEVEL_PROJECT)
177166
${--warn-errors}
178167
)
179168
endif()
169+
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0 AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0)
170+
# this stuff is, unfortunately, really poisonous and poorly implemented
171+
# in these GCC versions
172+
# (Wstringop-overflow) - [meta-bug] bogus/missing -Wstringop-overflow warnings
173+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443
174+
# Bogus -Wstringop-overflow warning
175+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100395
176+
# [10 Regression] spurious -Wstringop-overflow writing to a trailing array plus offset
177+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95353
178+
check_compiler_diagnostic(stringop-overflow)
179+
check_compiler_diagnostic(stringop-overread)
180+
check_compiler_diagnostic(array-bounds)
181+
target_compile_options(ztd.encoding_tables
182+
PRIVATE
183+
${--allow-stringop-overflow}
184+
${--allow-stringop-overread}
185+
${--allow-array-bounds})
186+
endif()
187+
180188

181189
install(TARGETS ztd.encoding_tables)
182190
install(DIRECTORY include/

0 commit comments

Comments
 (0)