From dcbc6a0a2131f176c1a7961a0115efefb6f02c99 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 27 Nov 2021 07:55:49 +0200 Subject: [PATCH 37/37] Meson: Move Windows specific setup before searching functions We need to have things set up correctly for Windows already when searching for the functions there. This initial patch to just move the Windows specific block alone does not achieve much. We will also need to add more functionality to it. See osdn #43270 Signed-off-by: Marko Lindqvist --- meson.build | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/meson.build b/meson.build index 6617fa9825..4c63b981ac 100644 --- a/meson.build +++ b/meson.build @@ -74,6 +74,21 @@ else cross_lib_path = [] endif +# From this, at least the _WIN32_WINNT must be set before +# trying to find the functions. +if host_system == 'windows' + pub_conf_data.set('FREECIV_MSWINDOWS', 1) + pub_conf_data.set('FREECIV_HAVE_TINYCTHR', 1) + pub_conf_data.set('FREECIV_HAVE_WINSOCK', 1) + pub_conf_data.set('FREECIV_SOCKET_ZERO_NOT_STDIN', 1) + priv_conf_data.set('ALWAYS_ROOT', 1) + add_global_arguments('-D_WIN32_WINNT=0x0601', language : 'c') + ws2_dep = c_compiler.find_library('ws2_32') +else + pub_conf_data.set('FREECIV_HAVE_PTHREAD', 1) + ws2_dep = [] +endif + pub_headers = [ 'locale.h', 'libintl.h', @@ -309,19 +324,6 @@ else priv_conf_data.set('ICONV_CONST', '') endif -if host_system == 'windows' - pub_conf_data.set('FREECIV_MSWINDOWS', 1) - pub_conf_data.set('FREECIV_HAVE_TINYCTHR', 1) - pub_conf_data.set('FREECIV_HAVE_WINSOCK', 1) - pub_conf_data.set('FREECIV_SOCKET_ZERO_NOT_STDIN', 1) - priv_conf_data.set('ALWAYS_ROOT', 1) - add_global_arguments('-D_WIN32_WINNT=0x0601', language : 'c') - ws2_dep = c_compiler.find_library('ws2_32') -else - pub_conf_data.set('FREECIV_HAVE_PTHREAD', 1) - ws2_dep = [] -endif - if get_option('cacert-path') != '' priv_conf_data.set('CUSTOM_CACERT_PATH', '"' + get_option('cacert-path') + '"') -- 2.33.0