From ff37ccf68bdae8d52c6e8406e7b124fe870e699c Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 4 Jul 2022 19:42:11 +0300 Subject: [PATCH 45/45] Meson: Support defining FREECIV_CROSSER Implemented as cross-file property, as crosser based build is always a cross-compilation. It would be an error to give such an option in native build. See osdn #44310 Signed-off-by: Marko Lindqvist --- gen_headers/meson_freeciv_config.h.in | 3 +++ meson.build | 6 ++++++ windows/installer_cross/meson/cross-win32.tmpl | 1 + windows/installer_cross/meson/cross-win64.tmpl | 1 + 4 files changed, 11 insertions(+) diff --git a/gen_headers/meson_freeciv_config.h.in b/gen_headers/meson_freeciv_config.h.in index 08a78669b4..0955be1110 100644 --- a/gen_headers/meson_freeciv_config.h.in +++ b/gen_headers/meson_freeciv_config.h.in @@ -60,6 +60,9 @@ /* Native language support enabled */ #mesondefine FREECIV_ENABLE_NLS +/* This is crosser-based build */ +#mesondefine FREECIV_CROSSER + /* Produce debug version */ #mesondefine FREECIV_DEBUG diff --git a/meson.build b/meson.build index 3778c56389..35842c3756 100644 --- a/meson.build +++ b/meson.build @@ -133,10 +133,12 @@ if meson.is_cross_build() cross_inc_str = meson.get_cross_property('cross_inc_path') cross_inc_path = [cross_inc_str] cross_lib_path = [meson.get_cross_property('cross_lib_path')] + crosser = meson.get_cross_property('crosser') else cross_inc_str = '' cross_inc_path = [] cross_lib_path = [] + crosser = false endif # From this, at least the _WIN32_WINNT must be set before @@ -520,6 +522,10 @@ if get_option('gitrev') priv_conf_data.set('GITREV', 1) endif +if crosser + pub_conf_data.set('FREECIV_CROSSER', 1) +endif + configure_file(input : 'gen_headers/meson_fc_config.h.in', output : 'fc_config.h', configuration: priv_conf_data) diff --git a/windows/installer_cross/meson/cross-win32.tmpl b/windows/installer_cross/meson/cross-win32.tmpl index b321471966..dd0c087249 100644 --- a/windows/installer_cross/meson/cross-win32.tmpl +++ b/windows/installer_cross/meson/cross-win32.tmpl @@ -15,6 +15,7 @@ endian = 'little' [properties] cross_inc_path = '/include' cross_lib_path = '/lib' +crosser = true [built-in options] c_link_args = ['-static-libgcc'] diff --git a/windows/installer_cross/meson/cross-win64.tmpl b/windows/installer_cross/meson/cross-win64.tmpl index 15767a5961..893af81a57 100644 --- a/windows/installer_cross/meson/cross-win64.tmpl +++ b/windows/installer_cross/meson/cross-win64.tmpl @@ -15,6 +15,7 @@ endian = 'little' [properties] cross_inc_path = '/include' cross_lib_path = '/lib' +crosser = true [built-in options] c_link_args = ['-static-libgcc'] -- 2.35.1