|
28 | 28 | # |
29 | 29 | # ============================================================================ # |
30 | 30 |
|
31 | | -cmake_minimum_required(VERSION 3.28.0) |
| 31 | +cmake_minimum_required(VERSION 3.31.0) |
32 | 32 |
|
33 | 33 | # # Project kickstart |
34 | 34 | # Includes a bunch of basic flags and utilities shared across projects |
@@ -111,17 +111,6 @@ if(ZTD_ENCODING_TABLES_IS_TOP_LEVEL_PROJECT) |
111 | 111 | check_compiler_diagnostic(microsoft-enum-value) |
112 | 112 | check_compiler_diagnostic(gnu-zero-variadic-macro-arguments) |
113 | 113 | 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() |
125 | 114 | endif() |
126 | 115 | endif() |
127 | 116 |
|
@@ -177,6 +166,25 @@ if(ZTD_ENCODING_TABLES_IS_TOP_LEVEL_PROJECT) |
177 | 166 | ${--warn-errors} |
178 | 167 | ) |
179 | 168 | 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 | + |
180 | 188 |
|
181 | 189 | install(TARGETS ztd.encoding_tables) |
182 | 190 | install(DIRECTORY include/ |
|
0 commit comments