From cc611869850c0001315f8c82c58994ee494441fa Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 2 Jul 2022 17:46:00 +0300 Subject: [PATCH 43/43] Meson: Support Cygwin See osdn #44933 Signed-off-by: Marko Lindqvist --- meson.build | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/meson.build b/meson.build index d868ce3881..3778c56389 100644 --- a/meson.build +++ b/meson.build @@ -176,7 +176,6 @@ pub_headers = [ priv_headers = [ 'arpa/inet.h', - 'bcrypt.h', 'bzlib.h', 'direct.h', 'dlfcn.h', @@ -218,20 +217,36 @@ foreach hdr : pub_headers endif endforeach -if c_compiler.has_header('ws2tcpip.h', args: header_arg) - net_incl = '''#include ''' - pub_conf_data.set('FREECIV_HAVE_WS2TCPIP_H', 1) - priv_conf_data.set('HAVE_WS2TCPIP_H', 1) -else - net_incl = '' -endif - foreach hdr : priv_headers if c_compiler.has_header(hdr, args: header_arg) priv_conf_data.set('HAVE_' + hdr.underscorify().to_upper(), 1) endif endforeach +if host_system == 'windows' + # We don't want Cygwin to find these, so checking only under "real" Windows layer + + win_priv_headers= [ + 'bcrypt.h' + ] + + if c_compiler.has_header('ws2tcpip.h', args: header_arg) + net_incl = '''#include ''' + pub_conf_data.set('FREECIV_HAVE_WS2TCPIP_H', 1) + priv_conf_data.set('HAVE_WS2TCPIP_H', 1) + else + net_incl = '' + endif + + foreach hdr : win_priv_headers + if c_compiler.has_header(hdr, args: header_arg) + priv_conf_data.set('HAVE_' + hdr.underscorify().to_upper(), 1) + endif + endforeach +else + net_incl = '' +endif + priv_functions = [ 'fork', 'vfork', -- 2.35.1