-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[cmake] Hardcode some check_include_file checks
#104706
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
Changes from 1 commit
a92b98b
0d468fd
31f51e4
25c080a
d226369
82bcfdb
608037b
b25fbf6
4ebf4ac
dc4c5d0
d5478cf
51278c1
75759a6
bc5391e
43dfb84
2294e6a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,12 @@ if (CMAKE_SYSTEM_NAME STREQUAL "NetBSD") | |
| set(NETBSD 1) | ||
| endif() | ||
|
|
||
| # Confirmed in | ||
| # https://github.com/llvm/llvm-project/pull/104706#issuecomment-2297153534 | ||
| if (CMAKE_SYSTEM_NAME MATCHES "OS390") | ||
| set(ZOS 1) | ||
| endif() | ||
|
|
||
| if (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") | ||
| set(OPENBSD 1) | ||
| endif() | ||
|
|
@@ -148,9 +154,30 @@ elseif (PURE_WINDOWS) | |
| set(HAVE_SYS_TYPES_H 1) | ||
Endilll marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| set(HAVE_SYSEXITS_H 0) | ||
| set(HAVE_TERMIOS_H 0) | ||
| elseif (ZOS) | ||
| # Confirmed in | ||
| # https://github.com/llvm/llvm-project/pull/104706#issuecomment-2297109613 | ||
| set(HAVE_DLFCN_H 1) | ||
| set(HAVE_ERRNO_H 1) | ||
| set(HAVE_FCNTL_H 1) | ||
| set(HAVE_FENV_H 1) | ||
| set(HAVE_LINK_H 0) | ||
| set(HAVE_MACH_MACH_H 0) | ||
| set(HAVE_MALLOC_MALLOC_H 0) | ||
| set(HAVE_PTHREAD_H 1) | ||
| set(HAVE_SIGNAL_H 1) | ||
| set(HAVE_SYS_IOCTL_H 1) | ||
| set(HAVE_SYS_MMAN_H 1) | ||
| set(HAVE_SYS_PARAM_H 0) | ||
| set(HAVE_SYS_RESOURCE_H 1) | ||
| set(HAVE_SYS_STAT_H 1) | ||
| set(HAVE_SYS_TIME_H 1) | ||
| set(HAVE_SYS_TYPES_H 1) | ||
| set(HAVE_SYSEXITS_H 0) | ||
| set(HAVE_TERMIOS_H 1) | ||
| set(HAVE_UNISTD_H 1) | ||
| else() | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In theory, once you set the values, the check queries will early-out because they detect the cached value. Having it always call the check functions (even if the value is set) may make it easy to add platforms where some of these are known to exist, but others may not be.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was referring to the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I've never felt I understood cache variables enough to feel comfortable relying on them. But I agree, this should be the case.
Are you sure this would serve a practical purpose? If one cares enough to set some of them beforehand to improve configuration times, I don't see how they would not check the rest.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I agree that this is the behavior (https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/CheckIncludeFile.cmake?ref_type=heads#L46), but I don't see it documented at https://cmake.org/cmake/help/latest/module/CheckIncludeFile.html. So I'm reluctant to rely on this. |
||
| # Other platforms that we don't promise support for. | ||
| # Notable exception is z/OS, which can't be detected via CMAKE_SYSTEM_NAME. | ||
| check_include_file(dlfcn.h HAVE_DLFCN_H) | ||
| check_include_file(errno.h HAVE_ERRNO_H) | ||
| check_include_file(fcntl.h HAVE_FCNTL_H) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The port of cmake to z/OS, in
Modules/Platform/OS390.cmake, already has this line in it. Will this be a problem?