Skip to content

Commit

Permalink
cmake: Remove unused checks.
Browse files Browse the repository at this point in the history
None of the header checks were used for that and can be removed.

One was used to check for `sys/time.h` and then enable `gettimeofday()`
so we can instead just check for the `gettimeofday()` function instead.

Remove unused check for size of `int`.

Remove unused check for `getpagesize()`.

Remove `GECODE_HAS_UNISTD_H` from the config header as it isn't
used or set by anything (any longer).
  • Loading branch information
waywardmonkeys authored and zayenz committed Nov 29, 2023
1 parent 3a29c3e commit c0de254
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 60 deletions.
59 changes: 2 additions & 57 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,42 +74,9 @@ file(READ gecode/support/config.hpp.in CONFIG)
string(REGEX REPLACE "^/\\*([^*]|\\*[^/])*\\*/" "" CONFIG ${CONFIG})
string(REGEX MATCHALL "[^\n]*\n" CONFIG
"${CONFIG}
/* Define to 1 if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
Expand All @@ -127,12 +94,6 @@ string(REGEX MATCHALL "[^\n]*\n" CONFIG
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of `int', as computed by sizeof. */
#undef SIZEOF_INT
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
")

# Get version numbers and parts of config.h from configure.ac.
Expand Down Expand Up @@ -251,26 +212,13 @@ if (NOT DEFINED GECODE_USE_QT OR GECODE_USE_QT)
endif ()

include(CheckSymbolExists)
check_symbol_exists(getpagesize unistd.h HAVE_GETPAGESIZE)
check_symbol_exists(mmap sys/mman.h HAVE_MMAP)

# Checks for header files.
include(CheckIncludeFiles)
foreach (header inttypes.h memory.h stdint.h stdlib.h strings.h string.h
sys/param.h sys/stat.h sys/time.h sys/types.h unistd.h)
string(TOUPPER HAVE_${header} var)
string(REGEX REPLACE "\\.|/" "_" var ${var})
check_include_files(${header} ${var})
endforeach ()
check_include_files(stdio.h STDC_HEADERS)
if (HAVE_SYS_TIME_H)
check_symbol_exists(gettimeofday sys/time.h HAVE_GETTIMEOFDAY)
if (HAVE_GETTIMEOFDAY)
set(GECODE_USE_GETTIMEOFDAY 1)
else ()
set(GECODE_USE_CLOCK 1)
endif ()
if (HAVE_UNISTD_H)
set(GECODE_HAS_UNISTD_H 1)
endif ()

include(CheckCXXSourceCompiles)
check_cxx_source_compiles("
Expand All @@ -287,9 +235,6 @@ if (HAVE_UNORDERED_MAP)
set(GECODE_HAS_UNORDERED_MAP "/**/")
endif ()

include(CheckTypeSize)
check_type_size(int SIZEOF_INT)

# Check for inline.
include(CheckCSourceCompiles)
check_c_source_compiles("
Expand Down
3 changes: 0 additions & 3 deletions gecode/support/config.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@
/* Whether to build SET variables */
#undef GECODE_HAS_SET_VARS

/* Whether unistd.h is available */
#undef GECODE_HAS_UNISTD_H

/* Whether unordered_map is available */
#undef GECODE_HAS_UNORDERED_MAP

Expand Down

0 comments on commit c0de254

Please sign in to comment.