[llvm] [cmake] Hardcode some `check_include_file` checks (PR #104706)

Sean Perry via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 13:54:02 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()
----------------
perry-ca wrote:

I was referring to the `set(ZOS 1)` line.  Since the cmake platform files are already defining `ZOS` should we be defining it in the llvm cmake files?

https://github.com/llvm/llvm-project/pull/104706


More information about the llvm-commits mailing list