[CMAKE] Fix host tools build on x86-64 mingw

Dynamically check for sys/types.h and pid_t in wine config.h
Use TARGET_xxx defines instead of _X86_ as this is undefined by GCC
Add some sense in include directories management by using interface
libraries
This commit is contained in:
Jérôme Gardou 2019-11-15 14:07:46 +01:00 committed by Jérôme Gardou
parent 15748cf03a
commit 493ceb7ade
19 changed files with 64 additions and 30 deletions

View file

@ -0,0 +1,19 @@
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})

View file

@ -3,6 +3,12 @@
#define __WINE_CONFIG_H
/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine HAVE_SYS_TYPES_H @HAVE_SYS_TYPES_H@
/* Define to 1 if the system has the type `pid_t'. */
#cmakedefine HAVE_PID_T 1
#define HAVE_SPAWNVP 1
/* Define to 1 if you have the `z' library (-lz). */