@@ -18,14 +18,18 @@ if("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")
1818endif ()
1919
2020if (CMAKE_SYSTEM_NAME STREQUAL Windows)
21- include (DispatchWindowsSupport)
22- dispatch_windows_arch_spelling(${CMAKE_SYSTEM_PROCESSOR} DISPATCH_MSVC_ARCH)
23- dispatch_windows_include_for_arch(${DISPATCH_MSVC_ARCH} DISPATCH_INCLUDES)
24- include_directories (BEFORE SYSTEM ${DISPATCH_INCLUDES} )
25- dispatch_windows_lib_for_arch(${CMAKE_SYSTEM_PROCESSOR} DISPATCH_LIBDIR)
26- link_directories (${DISPATCH_LIBDIR} )
21+ if (NOT MINGW)
22+ include (DispatchWindowsSupport)
23+ dispatch_windows_arch_spelling(${CMAKE_SYSTEM_PROCESSOR} DISPATCH_MSVC_ARCH)
24+ dispatch_windows_include_for_arch(${DISPATCH_MSVC_ARCH} DISPATCH_INCLUDES)
25+ include_directories (BEFORE SYSTEM ${DISPATCH_INCLUDES} )
26+ dispatch_windows_lib_for_arch(${CMAKE_SYSTEM_PROCESSOR} DISPATCH_LIBDIR)
27+ link_directories (${DISPATCH_LIBDIR} )
28+ endif ()
2729
2830 include (CheckCSourceCompiles)
31+ include (CheckSymbolExists)
32+
2933 check_c_source_compiles([=[
3034#include <Windows.h>
3135int main(int argc, char *argv[]) {
@@ -54,6 +58,42 @@ int main(int argc, char *argv[]) {
5458 if (DISPATCH_HAVE_EXTENDED_SLPI_22000)
5559 add_compile_definitions (DISPATCH_HAVE_EXTENDED_SLPI_22000)
5660 endif ()
61+
62+ check_c_source_compiles([=[
63+ #include <Windows.h>
64+ #include <winternl.h>
65+ int main(int argc, char *argv[]) {
66+ FILE_PIPE_LOCAL_INFORMATION fpli;
67+ }
68+ ]=] HAVE_FILE_PIPE_LOCAL_INFORMATION)
69+ if (HAVE_FILE_PIPE_LOCAL_INFORMATION)
70+ add_compile_definitions (HAVE_FILE_PIPE_LOCAL_INFORMATION)
71+ endif ()
72+
73+ check_symbol_exists(mkstemp "stdlib.h" HAVE_MKSTEMP)
74+ if (HAVE_MKSTEMP)
75+ add_compile_definitions (HAVE_MKSTEMP)
76+ endif ()
77+
78+ check_c_source_compiles([=[
79+ #include <sys/types.h>
80+ int main(int argc, char *argv[]) {
81+ mode_t mode;
82+ }
83+ ]=] HAVE_MODE_T)
84+ if (HAVE_MODE_T)
85+ add_compile_definitions (HAVE_MODE_T)
86+ endif ()
87+
88+ check_c_source_compiles([=[
89+ #include <sys/types.h>
90+ int main(int argc, char *argv[]) {
91+ pid_t mode;
92+ }
93+ ]=] HAVE_PID_T)
94+ if (HAVE_PID_T)
95+ add_compile_definitions (HAVE_PID_T)
96+ endif ()
5797endif ()
5898
5999set (CMAKE_C_STANDARD 11)
0 commit comments