blob: 8a6d46df799b5533f6e979899602a8ef86bfe5be [file] [log] [blame]
Andrew Geissler6ce62a22020-11-30 19:58:47 -06001From 333809ded70ad4e3470b7134e3fac1a42ff48e61 Mon Sep 17 00:00:00 2001
Brad Bishop19323692019-04-05 15:28:33 -04002From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Wed, 13 Feb 2019 15:32:05 +0100
4Subject: [PATCH] Set host_machine correctly when building with mingw32
5
6Upstream-Status: Inappropriate [oe-core specific]
7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
8
9---
10 gio/tests/meson.build | 8 ++++----
Brad Bishop15ae2502019-06-18 21:44:24 -040011 glib/tests/meson.build | 2 +-
Brad Bishop19323692019-04-05 15:28:33 -040012 meson.build | 3 +++
13 tests/meson.build | 2 +-
Brad Bishop15ae2502019-06-18 21:44:24 -040014 4 files changed, 9 insertions(+), 6 deletions(-)
Brad Bishop19323692019-04-05 15:28:33 -040015
16diff --git a/gio/tests/meson.build b/gio/tests/meson.build
Andrew Geissler6ce62a22020-11-30 19:58:47 -060017index 3a19c82..b762835 100644
Brad Bishop19323692019-04-05 15:28:33 -040018--- a/gio/tests/meson.build
19+++ b/gio/tests/meson.build
Andrew Geisslerc926e172021-05-07 16:11:35 -050020@@ -27,7 +27,7 @@ test_c_args = [
21 endif # libutil.length() > 0
22 endif # build_machine.system() == 'linux'
Brad Bishop19323692019-04-05 15:28:33 -040023
24-if host_machine.system() == 'windows'
25+if host_system == 'windows'
26 common_gio_tests_deps += [iphlpapi_dep, winsock2, cc.find_library ('secur32')]
27 endif
28
Andrew Geisslerc926e172021-05-07 16:11:35 -050029@@ -148,7 +148,7 @@ else
Brad Bishop19323692019-04-05 15:28:33 -040030 endif
31
32 # Test programs buildable on UNIX only
33-if host_machine.system() != 'windows'
34+if host_system != 'windows'
Brad Bishop15ae2502019-06-18 21:44:24 -040035 gio_tests += {
Brad Bishop19323692019-04-05 15:28:33 -040036 'file' : {},
37 'gdbus-peer' : {
Andrew Geisslerc926e172021-05-07 16:11:35 -050038@@ -402,7 +402,7 @@ if host_machine.system() != 'windows'
Brad Bishop19323692019-04-05 15:28:33 -040039 endif # unix
40
41 # Test programs buildable on Windows only
42-if host_machine.system() == 'windows'
43+if host_system == 'windows'
Brad Bishop15ae2502019-06-18 21:44:24 -040044 gio_tests += {'win32-streams' : {}}
Brad Bishop19323692019-04-05 15:28:33 -040045 endif
46
Andrew Geisslerc926e172021-05-07 16:11:35 -050047@@ -472,7 +472,7 @@ if cc.get_id() != 'msvc' and cc.get_id() != 'clang-cl'
Brad Bishop15ae2502019-06-18 21:44:24 -040048 }
Brad Bishop19323692019-04-05 15:28:33 -040049 endif
50
51-if host_machine.system() != 'windows'
52+if host_system != 'windows'
Brad Bishop15ae2502019-06-18 21:44:24 -040053 test_extra_programs += {
Brad Bishop19323692019-04-05 15:28:33 -040054 'gdbus-example-unix-fd-client' : {
55 'install' : false,
56diff --git a/glib/tests/meson.build b/glib/tests/meson.build
Andrew Geissler6ce62a22020-11-30 19:58:47 -060057index 6eb23e8..36eb919 100644
Brad Bishop19323692019-04-05 15:28:33 -040058--- a/glib/tests/meson.build
59+++ b/glib/tests/meson.build
Andrew Geisslerc926e172021-05-07 16:11:35 -050060@@ -142,7 +142,7 @@ if glib_conf.has('HAVE_EVENTFD')
Brad Bishop15ae2502019-06-18 21:44:24 -040061 }
62 endif
63
64-if host_machine.system() == 'windows'
65+if host_system == 'windows'
66 if winsock2.found()
67 glib_tests += {
68 'gpoll' : {
Brad Bishop19323692019-04-05 15:28:33 -040069diff --git a/meson.build b/meson.build
Andrew Geissler6ce62a22020-11-30 19:58:47 -060070index 47f3a5c..7ea7ad1 100644
Brad Bishop19323692019-04-05 15:28:33 -040071--- a/meson.build
72+++ b/meson.build
Brad Bishopf3f93bb2019-10-16 14:33:32 -040073@@ -32,6 +32,9 @@ else
Brad Bishop19323692019-04-05 15:28:33 -040074 endif
75
76 host_system = host_machine.system()
77+if host_system == 'mingw32'
78+ host_system = 'windows'
79+endif
80
Andrew Geissler6ce62a22020-11-30 19:58:47 -060081 if host_system == 'darwin'
82 ios_test_code = '''#include <TargetConditionals.h>
Brad Bishop19323692019-04-05 15:28:33 -040083diff --git a/tests/meson.build b/tests/meson.build
Andrew Geissler4b740dc2020-05-05 08:54:39 -050084index 6741f8f..12fdc90 100644
Brad Bishop19323692019-04-05 15:28:33 -040085--- a/tests/meson.build
86+++ b/tests/meson.build
Andrew Geissler4b740dc2020-05-05 08:54:39 -050087@@ -73,7 +73,7 @@ test_extra_programs = {
Brad Bishop19323692019-04-05 15:28:33 -040088 'unicode-collate' : {},
89 }
90
91-if host_machine.system() != 'windows'
92+if host_system != 'windows'
Brad Bishop15ae2502019-06-18 21:44:24 -040093 tests += {
Brad Bishop19323692019-04-05 15:28:33 -040094 'timeloop' : {},
Brad Bishop15ae2502019-06-18 21:44:24 -040095 'iochannel-test' : {},