[CMAKE] Define HAVE_* constants unconditionally (follow-up to PR #2041) (#2052)

sys/types.h is guaranteed to be available on all our supported host platforms and always contains a pid_t definition.
This commit is contained in:
Colin Finck 2019-11-18 18:57:35 +01:00 committed by GitHub
parent 803532b8c2
commit eb0f16433b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 19 deletions

View file

@ -1,19 +1,3 @@
include(CheckIncludeFile)
include(CheckTypeSize)
# check for <sys/types.h>
CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
# check for pid_t definition
if (HAVE_SYS_TYPES_H)
set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h")
#this sets HAVE_PID_T
CHECK_TYPE_SIZE("pid_t" PID_T)
unset(CMAKE_EXTRA_INCLUDE_FILES)
endif()
configure_file(config.h.in config.h @ONLY)
add_library(host_includes INTERFACE)
target_include_directories(host_includes INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(host_includes INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})