Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: move global headers to specific checks #11951

Closed

Conversation

vszakats
Copy link
Member

@vszakats vszakats commented Sep 26, 2023

Before this patch we added standard headers unconditionally to the
global list of headers used for feature checks. This is unnecessary
and also doesn't help CMake 'Generate' performance. This patch moves
these headers to each feature check where they are actually needed.
Stop using stddef.h, as it seems unnecessary.

I've used autotools' m4/curl-functions.m4 to figure out these
dependencies.

Also delete checking for the C89 standard header time.h, that I
missed in the earlier commit.

Ref: 96c2990 #11940

Closes #11951

Based on autotools logic in `m4/curl-functions.m4`.
Based on autotools logic in `m4/curl-functions.m4`,
`stddef.h` isn't necessary for any detection.
Based on autotools logic in `m4/curl-functions.m4`.
@vszakats vszakats closed this in 3795fcd Sep 26, 2023
@vszakats vszakats deleted the cmake-narrow-detection-header-use branch September 26, 2023 22:14
vszakats added a commit to vszakats/curl that referenced this pull request Oct 5, 2023
We removed C89 `setjmp.h` and `signal.h` detections and excluded them
from the global header list we use for detecting functions [1]. Then
missed to re-add these headers to the specific functions which need
them to be detected [2]. Fix this omission in this patch.

`sigsetjmp` has a second detection attempt documented as 'special' in
the comment. However this detection uses the same method as the first
attempt, with the difference of using `setjmp.h` header only, without
including the rest of non-standard headers detected. It detects both
function and macro like the first attempt. This second attempt seems
redundant. It's been there since the initial commit of CMake support.

[1] Follow-up to 3795fcd curl#11951
[2] Follow-up to 96c2990 curl#11940

Closes #xxxxx
vszakats added a commit that referenced this pull request Oct 6, 2023
We removed C89 `setjmp.h` and `signal.h` detections and excluded them
from the global header list we use when detecting functions [1]. Then
missed to re-add these headers to the specific functions which need
them to be detected [2]. Fix this omission in this patch.

[1] Follow-up to 3795fcd #11951
[2] Follow-up to 96c2990 #11940

Closes #12043
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

1 participant