cmake: speed up and extend picky clang/gcc options

Extend existing picky compiler options with ones missing compared to
autotools builds. Also sync options between clang and gcc.

Redesign the way we enable these options to avoid the slow option
detection almost completely.

This reduces the number of detections from 35 to zero for clang and
3 for gcc, even after adding a bunch of new options.

clang 3.0 (2011-11-29) and gcc 2.95 (1999-07-31) now required.

Also show enabled picky options.

Ref: https://github.com/libssh2/libssh2/pull/952

Reviewed-by: Daniel Stenberg
Closes #10973
This commit is contained in:
Viktor Szakats 2023-04-16 22:28:25 +00:00
parent 15a361892d
commit 9c543de0ec
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
3 changed files with 199 additions and 22 deletions

View file

@ -49,6 +49,7 @@ CMAKE_DIST = \
CMake/FindZstd.cmake \
CMake/Macros.cmake \
CMake/OtherTests.cmake \
CMake/PickyWarnings.cmake \
CMake/Platforms/WindowsCache.cmake \
CMake/Utilities.cmake \
CMakeLists.txt