From 29ad25deb521c275be8620a8db30a3c8274765fa Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 31 Dec 2022 11:46:17 +0200 Subject: [PATCH 38/38] Meson: Use cross-compile include paths in compilation tests See osdn #46357 Signed-off-by: Marko Lindqvist --- meson.build | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 747aee4ee2..3afef78921 100644 --- a/meson.build +++ b/meson.build @@ -368,7 +368,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 @@ -441,13 +442,15 @@ endif if c_compiler.compiles(''' #include -int main(void) { int *var = nullptr; return 0; }''') +int main(void) { int *var = nullptr; return 0; }''', + include_directories: include_directories(cross_inc_path)) pub_conf_data.set('FREECIV_HAVE_C23_NULLPTR', 1) endif if cxx_compiler.compiles(''' #include -int main(void) { int *var = nullptr; return 0; }''') +int main(void) { int *var = nullptr; return 0; }''', + include_directories: include_directories(cross_inc_path)) pub_conf_data.set('FREECIV_HAVE_CXX_NULLPTR', 1) endif @@ -502,7 +505,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 @@ -518,7 +522,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', '') @@ -540,6 +545,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