Return the max supported C++ std level (17, 14, or 11). Returns latest on Windows.
(compiler: Any)
| 251 | |
| 252 | @lru_cache |
| 253 | def auto_cpp_level(compiler: Any) -> str | int: |
| 254 | """ |
| 255 | Return the max supported C++ std level (17, 14, or 11). Returns latest on Windows. |
| 256 | """ |
| 257 | |
| 258 | if WIN: |
| 259 | return "latest" |
| 260 | |
| 261 | levels = [17, 14, 11] |
| 262 | |
| 263 | for level in levels: |
| 264 | if has_flag(compiler, STD_TMPL.format(level)): |
| 265 | return level |
| 266 | |
| 267 | msg = "Unsupported compiler -- at least C++11 support is needed!" |
| 268 | raise RuntimeError(msg) |
| 269 | |
| 270 | |
| 271 | class build_ext(_build_ext): # noqa: N801 |
no test coverage detected