[llvm] [cmake] Hardcode some `check_include_file` checks (PR #104706)
Chris B via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 19 13:49:42 PDT 2024
================
@@ -17,6 +55,150 @@ include(CheckCompilerVersion)
include(CheckProblematicConfigurations)
include(HandleLLVMStdlib)
+if (ANDROID OR DRAGONFLY OR FREEBSD OR HAIKU OR LINUX OR NETBSD OR OPENBSD OR SOLARIS)
+ set(HAVE_DLFCN_H 1)
+ set(HAVE_ERRNO_H 1)
+ set(HAVE_FCNTL_H 1)
+ set(HAVE_FENV_H 1)
+ set(HAVE_LINK_H 1)
+ 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 1)
+ 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 1)
+ set(HAVE_TERMIOS_H 1)
+ set(HAVE_UNISTD_H 1)
+elseif (AIX)
+ set(HAVE_DLFCN_H 1)
+ set(HAVE_ERRNO_H 1)
+ set(HAVE_FCNTL_H 1)
+ set(HAVE_FENV_H 0)
+ 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 0)
+ set(HAVE_SYS_MMAN_H 0)
+ set(HAVE_SYS_PARAM_H 1)
+ set(HAVE_SYS_RESOURCE_H 0)
+ set(HAVE_SYS_STAT_H 1)
+ set(HAVE_SYS_TIME_H 0)
+ set(HAVE_SYS_TYPES_H 1)
+ set(HAVE_SYSEXITS_H 0)
+ set(HAVE_TERMIOS_H 1)
+ set(HAVE_UNISTD_H 1)
+elseif (APPLE)
+ 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 1)
+ set(HAVE_MALLOC_MALLOC_H 1)
+ 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 1)
+ 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 1)
+ set(HAVE_TERMIOS_H 1)
+ set(HAVE_UNISTD_H 1)
+elseif (CYGWIN)
+ 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 1)
+ 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 1)
+ set(HAVE_TERMIOS_H 1)
+ set(HAVE_UNISTD_H 1)
+elseif (PURE_WINDOWS)
+ set(HAVE_DLFCN_H 0)
+ 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 0)
+ set(HAVE_SIGNAL_H 1)
+ set(HAVE_SYS_IOCTL_H 0)
+ set(HAVE_SYS_MMAN_H 0)
+ set(HAVE_SYS_PARAM_H 0)
+ set(HAVE_SYS_RESOURCE_H 0)
+ set(HAVE_SYS_STAT_H 1)
+ set(HAVE_SYS_TIME_H 0)
+ set(HAVE_SYS_TYPES_H 1)
+ 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()
----------------
llvm-beanz wrote:
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.
https://github.com/llvm/llvm-project/pull/104706
More information about the llvm-commits
mailing list