Skip to content

cmake: enable -pedantic-errors for clang when CURL_WERROR=ON#13286

Closed
vszakats wants to merge 3 commits intocurl:masterfrom
vszakats:cmake-pedantic-clang
Closed

cmake: enable -pedantic-errors for clang when CURL_WERROR=ON#13286
vszakats wants to merge 3 commits intocurl:masterfrom
vszakats:cmake-pedantic-clang

Conversation

@vszakats
Copy link
Member

@vszakats vszakats commented Apr 4, 2024

clang doesn't have the issues of GCC and old CMake versions.

Note: This introduces asymmetry with autotools, which only enables
this for GCC.

Closes #13286

@github-actions github-actions bot added the CI Continuous Integration label Apr 4, 2024
vszakats added 3 commits April 5, 2024 09:32
`-pedantic-errors` option throws a warning with GCC (all versions) in
`check_symbol_exists()`, which makes feature checks fail. CMake v3.23.0
(2022-03-29) introduced a workaround:

https://gitlab.kitware.com/cmake/cmake/-/issues/13208
https://gitlab.kitware.com/cmake/cmake/-/commit/eeb45401163d831b8c841ef6eba81466b4067b68
https://gitlab.kitware.com/cmake/cmake/-/commit/1ab7c3cd28b27ca162c4559e1026e5cad1898ade

Make sure to not enable this option for CMake versions older than that.

Follow-up to 3829759 curl#12489
clang doesn't have the issues of GCC and old CMake versions.

Note: This introduces asymmetry with autotools, which only enables
this for GCC.

Closes #xxxxx
@vszakats vszakats force-pushed the cmake-pedantic-clang branch from 3e7c7b5 to d956cbd Compare April 5, 2024 09:33
@vszakats vszakats closed this in 11d27cf Apr 5, 2024
@vszakats vszakats deleted the cmake-pedantic-clang branch April 5, 2024 13:07
vszakats added a commit to vszakats/curl that referenced this pull request Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build CI Continuous Integration cmake

Development

Successfully merging this pull request may close these issues.

2 participants