Skip to content

Commit c0de254

Browse files
waywardmonkeyszayenz
authored andcommitted
cmake: Remove unused checks.
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).
1 parent 3a29c3e commit c0de254

File tree

2 files changed

+2
-60
lines changed

2 files changed

+2
-60
lines changed

CMakeLists.txt

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -74,42 +74,9 @@ file(READ gecode/support/config.hpp.in CONFIG)
7474
string(REGEX REPLACE "^/\\*([^*]|\\*[^/])*\\*/" "" CONFIG ${CONFIG})
7575
string(REGEX MATCHALL "[^\n]*\n" CONFIG
7676
"${CONFIG}
77-
/* Define to 1 if you have the `getpagesize' function. */
78-
#undef HAVE_GETPAGESIZE
79-
80-
/* Define to 1 if you have the <inttypes.h> header file. */
81-
#undef HAVE_INTTYPES_H
82-
83-
/* Define to 1 if you have the <memory.h> header file. */
84-
#undef HAVE_MEMORY_H
85-
8677
/* Define to 1 if you have a working `mmap' system call. */
8778
#undef HAVE_MMAP
8879
89-
/* Define to 1 if you have the <stdint.h> header file. */
90-
#undef HAVE_STDINT_H
91-
92-
/* Define to 1 if you have the <stdlib.h> header file. */
93-
#undef HAVE_STDLIB_H
94-
95-
/* Define to 1 if you have the <strings.h> header file. */
96-
#undef HAVE_STRINGS_H
97-
98-
/* Define to 1 if you have the <string.h> header file. */
99-
#undef HAVE_STRING_H
100-
101-
/* Define to 1 if you have the <sys/param.h> header file. */
102-
#undef HAVE_SYS_PARAM_H
103-
104-
/* Define to 1 if you have the <sys/stat.h> header file. */
105-
#undef HAVE_SYS_STAT_H
106-
107-
/* Define to 1 if you have the <sys/types.h> header file. */
108-
#undef HAVE_SYS_TYPES_H
109-
110-
/* Define to 1 if you have the <unistd.h> header file. */
111-
#undef HAVE_UNISTD_H
112-
11380
/* Define to the address where bug reports for this package should be sent. */
11481
#undef PACKAGE_BUGREPORT
11582
@@ -127,12 +94,6 @@ string(REGEX MATCHALL "[^\n]*\n" CONFIG
12794
12895
/* Define to the version of this package. */
12996
#undef PACKAGE_VERSION
130-
131-
/* The size of `int', as computed by sizeof. */
132-
#undef SIZEOF_INT
133-
134-
/* Define to 1 if you have the ANSI C header files. */
135-
#undef STDC_HEADERS
13697
")
13798

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

253214
include(CheckSymbolExists)
254-
check_symbol_exists(getpagesize unistd.h HAVE_GETPAGESIZE)
255215
check_symbol_exists(mmap sys/mman.h HAVE_MMAP)
256-
257-
# Checks for header files.
258-
include(CheckIncludeFiles)
259-
foreach (header inttypes.h memory.h stdint.h stdlib.h strings.h string.h
260-
sys/param.h sys/stat.h sys/time.h sys/types.h unistd.h)
261-
string(TOUPPER HAVE_${header} var)
262-
string(REGEX REPLACE "\\.|/" "_" var ${var})
263-
check_include_files(${header} ${var})
264-
endforeach ()
265-
check_include_files(stdio.h STDC_HEADERS)
266-
if (HAVE_SYS_TIME_H)
216+
check_symbol_exists(gettimeofday sys/time.h HAVE_GETTIMEOFDAY)
217+
if (HAVE_GETTIMEOFDAY)
267218
set(GECODE_USE_GETTIMEOFDAY 1)
268219
else ()
269220
set(GECODE_USE_CLOCK 1)
270221
endif ()
271-
if (HAVE_UNISTD_H)
272-
set(GECODE_HAS_UNISTD_H 1)
273-
endif ()
274222

275223
include(CheckCXXSourceCompiles)
276224
check_cxx_source_compiles("
@@ -287,9 +235,6 @@ if (HAVE_UNORDERED_MAP)
287235
set(GECODE_HAS_UNORDERED_MAP "/**/")
288236
endif ()
289237

290-
include(CheckTypeSize)
291-
check_type_size(int SIZEOF_INT)
292-
293238
# Check for inline.
294239
include(CheckCSourceCompiles)
295240
check_c_source_compiles("

gecode/support/config.hpp.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@
9090
/* Whether to build SET variables */
9191
#undef GECODE_HAS_SET_VARS
9292

93-
/* Whether unistd.h is available */
94-
#undef GECODE_HAS_UNISTD_H
95-
9693
/* Whether unordered_map is available */
9794
#undef GECODE_HAS_UNORDERED_MAP
9895

0 commit comments

Comments
 (0)