From 7c3a52a0e745ff4dfd9549326503b82a28ffd8ac Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 31 Dec 2022 11:48:29 +0200 Subject: [PATCH 30/30] Meson: Use cross-compile include paths in compilation tests See osdn #46357 Signed-off-by: Marko Lindqvist --- meson.build | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index e3e08d902e..40f5f81935 100644 --- a/meson.build +++ b/meson.build @@ -329,7 +329,8 @@ if c_compiler.has_function('getaddrinfo', dependencies: net_dep) else # Maybe it exist as a macro instead? if c_compiler.compiles(net_incl + ''' -int main(void) { getaddrinfo(NULL, NULL, NULL, NULL); }''') +int main(void) { getaddrinfo(NULL, NULL, NULL, NULL); }''', + include_directories: include_directories(cross_inc_path)) priv_conf_data.set('HAVE_GETADDRINFO', 1) pub_conf_data.set('FREECIV_IPV6_SUPPORT', 1) else @@ -451,7 +452,8 @@ else endif if c_compiler.compiles('''#include -int main(void) { struct ip_mreqn req; req.imr_ifindex = 0; return 0; }''') +int main(void) { struct ip_mreqn req; req.imr_ifindex = 0; return 0; }''', + include_directories: include_directories(cross_inc_path)) priv_conf_data.set('HAVE_IP_MREQN', 1) endif @@ -467,7 +469,8 @@ endif if c_compiler.compiles('''#include #include -int main(void) { iconv_t cd; const char **c; iconv(cd, c, NULL, NULL); return 0; }''') +int main(void) { iconv_t cd; const char **c; iconv(cd, c, NULL, NULL); return 0; }''', + include_directories: include_directories(cross_inc_path)) priv_conf_data.set('ICONV_CONST', 'const') else priv_conf_data.set('ICONV_CONST', '') @@ -489,6 +492,7 @@ void fr(const char *form, ...) #define fr(_a_,_b_) printf(_a_,_b_) #endif int main(void) { size_t var = 0; fr("''' + format + '''", var); return 0; }''', + include_directories: include_directories(cross_inc_path), args: ['-Werror', '-Wall']) priv_conf_data.set('SIZE_T_PRINTF', '"' + format + '"') break -- 2.39.0