blob: 59de3fa969a47db82719d301bd5726b287da93d0 [file] [log] [blame]
Andrew Geissler9aee5002022-03-30 16:27:02 +00001From 4f327be49fd6ac5a77da6e48459b37f37a601977 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>
Brad Bishop19323692019-04-05 15:28:33 -04008---
9 gio/tests/meson.build | 8 ++++----
Brad Bishop15ae2502019-06-18 21:44:24 -040010 glib/tests/meson.build | 2 +-
Brad Bishop19323692019-04-05 15:28:33 -040011 meson.build | 3 +++
12 tests/meson.build | 2 +-
Brad Bishop15ae2502019-06-18 21:44:24 -040013 4 files changed, 9 insertions(+), 6 deletions(-)
Brad Bishop19323692019-04-05 15:28:33 -040014
15diff --git a/gio/tests/meson.build b/gio/tests/meson.build
Andrew Geissler9aee5002022-03-30 16:27:02 +000016index abe676767c60..34b347815308 100644
Brad Bishop19323692019-04-05 15:28:33 -040017--- a/gio/tests/meson.build
18+++ b/gio/tests/meson.build
Andrew Geissler9aee5002022-03-30 16:27:02 +000019@@ -27,7 +27,7 @@ if build_machine.system() == 'linux'
Andrew Geisslerc926e172021-05-07 16:11:35 -050020 endif # libutil.length() > 0
21 endif # build_machine.system() == 'linux'
Brad Bishop19323692019-04-05 15:28:33 -040022
23-if host_machine.system() == 'windows'
24+if host_system == 'windows'
25 common_gio_tests_deps += [iphlpapi_dep, winsock2, cc.find_library ('secur32')]
26 endif
27
Andrew Geissler9aee5002022-03-30 16:27:02 +000028@@ -176,7 +176,7 @@ else
Brad Bishop19323692019-04-05 15:28:33 -040029 endif
30
31 # Test programs buildable on UNIX only
32-if host_machine.system() != 'windows'
33+if host_system != 'windows'
Brad Bishop15ae2502019-06-18 21:44:24 -040034 gio_tests += {
Brad Bishop19323692019-04-05 15:28:33 -040035 'file' : {},
36 'gdbus-peer' : {
Andrew Geissler9aee5002022-03-30 16:27:02 +000037@@ -434,7 +434,7 @@ if host_machine.system() != 'windows'
Brad Bishop19323692019-04-05 15:28:33 -040038 endif # unix
39
40 # Test programs buildable on Windows only
41-if host_machine.system() == 'windows'
42+if host_system == 'windows'
Brad Bishop15ae2502019-06-18 21:44:24 -040043 gio_tests += {'win32-streams' : {}}
Brad Bishop19323692019-04-05 15:28:33 -040044 endif
45
Andrew Geissler9aee5002022-03-30 16:27:02 +000046@@ -504,7 +504,7 @@ if cc.get_id() != 'msvc' and cc.get_id() != 'clang-cl'
Brad Bishop15ae2502019-06-18 21:44:24 -040047 }
Brad Bishop19323692019-04-05 15:28:33 -040048 endif
49
50-if host_machine.system() != 'windows'
51+if host_system != 'windows'
Brad Bishop15ae2502019-06-18 21:44:24 -040052 test_extra_programs += {
Brad Bishop19323692019-04-05 15:28:33 -040053 'gdbus-example-unix-fd-client' : {
54 'install' : false,
55diff --git a/glib/tests/meson.build b/glib/tests/meson.build
Andrew Geissler9aee5002022-03-30 16:27:02 +000056index a0c64afe6ae9..48407f99569c 100644
Brad Bishop19323692019-04-05 15:28:33 -040057--- a/glib/tests/meson.build
58+++ b/glib/tests/meson.build
Andrew Geissler9aee5002022-03-30 16:27:02 +000059@@ -151,7 +151,7 @@ if glib_conf.has('HAVE_EVENTFD')
Brad Bishop15ae2502019-06-18 21:44:24 -040060 }
61 endif
62
63-if host_machine.system() == 'windows'
64+if host_system == 'windows'
65 if winsock2.found()
66 glib_tests += {
67 'gpoll' : {
Brad Bishop19323692019-04-05 15:28:33 -040068diff --git a/meson.build b/meson.build
Andrew Geissler9aee5002022-03-30 16:27:02 +000069index e0b14319fb58..f6756a3c7dfb 100644
Brad Bishop19323692019-04-05 15:28:33 -040070--- a/meson.build
71+++ b/meson.build
Andrew Geissler9aee5002022-03-30 16:27:02 +000072@@ -54,6 +54,9 @@ else
Brad Bishop19323692019-04-05 15:28:33 -040073 endif
74
75 host_system = host_machine.system()
76+if host_system == 'mingw32'
77+ host_system = 'windows'
78+endif
79
Andrew Geissler6ce62a22020-11-30 19:58:47 -060080 if host_system == 'darwin'
81 ios_test_code = '''#include <TargetConditionals.h>
Brad Bishop19323692019-04-05 15:28:33 -040082diff --git a/tests/meson.build b/tests/meson.build
Andrew Geissler9aee5002022-03-30 16:27:02 +000083index 5ff99a4a8258..8a4dad0ccae7 100644
Brad Bishop19323692019-04-05 15:28:33 -040084--- a/tests/meson.build
85+++ b/tests/meson.build
Andrew Geissler9aee5002022-03-30 16:27:02 +000086@@ -53,7 +53,7 @@ test_extra_programs = {
87 'assert-msg-test' : {},
Brad Bishop19323692019-04-05 15:28:33 -040088 }
89
90-if host_machine.system() != 'windows'
91+if host_system != 'windows'
Brad Bishop15ae2502019-06-18 21:44:24 -040092 tests += {
Brad Bishop19323692019-04-05 15:28:33 -040093 'timeloop' : {},
Andrew Geissler9aee5002022-03-30 16:27:02 +000094 }
95--
962.34.1
97