forked from FluidSynth/fluidsynth
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathCheckSTDC.cmake
More file actions
36 lines (32 loc) · 1.18 KB
/
CheckSTDC.cmake
File metadata and controls
36 lines (32 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
message(STATUS "Checking whether system has ANSI C header files")
include(CheckPrototypeExists)
include(CheckIncludeFiles)
check_include_files("dlfcn.h;stdint.h;stddef.h;inttypes.h;stdlib.h;strings.h;string.h;float.h" StandardHeadersExist)
if(StandardHeadersExist)
check_prototype_exists(memchr string.h memchrExists)
if(memchrExists)
check_prototype_exists(free stdlib.h freeExists)
if(freeExists)
message(STATUS "ANSI C header files - found")
set(STDC_HEADERS 1 CACHE INTERNAL "System has ANSI C header files")
set(HAVE_STRINGS_H 1)
set(HAVE_STRING_H 1)
set(HAVE_FLOAT_H 1)
set(HAVE_STDLIB_H 1)
set(HAVE_STDDEF_H 1)
set(HAVE_STDINT_H 1)
set(HAVE_INTTYPES_H 1)
endif(freeExists)
endif(memchrExists)
endif(StandardHeadersExist)
if(NOT STDC_HEADERS)
message(STATUS "ANSI C header files - not found")
set(STDC_HEADERS 0 CACHE INTERNAL "System has ANSI C header files")
endif(NOT STDC_HEADERS)
check_include_files(unistd.h HAVE_UNISTD_H)
include(CheckDIRSymbolExists)
check_dirsymbol_exists("sys/stat.h;sys/types.h;dirent.h" HAVE_DIRENT_H)
if (HAVE_DIRENT_H)
set(HAVE_SYS_STAT_H 1)
set(HAVE_SYS_TYPES_H 1)
endif (HAVE_DIRENT_H)