summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/meson.bbclass13
1 files changed, 11 insertions, 2 deletions
diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass
index e1a13bbbf7..71f9de1a57 100644
--- a/meta/classes/meson.bbclass
+++ b/meta/classes/meson.bbclass
@@ -62,6 +62,15 @@ def meson_cpu_family(var, d):
62 else: 62 else:
63 return arch 63 return arch
64 64
65# Map our OS values to what Meson expects:
66# https://mesonbuild.com/Reference-tables.html#operating-system-names
67def meson_operating_system(var, d):
68 os = d.getVar(var)
69 if "mingw" in os:
70 return "windows"
71 else:
72 return os
73
65def meson_endian(prefix, d): 74def meson_endian(prefix, d):
66 arch, os = d.getVar(prefix + "_ARCH"), d.getVar(prefix + "_OS") 75 arch, os = d.getVar(prefix + "_ARCH"), d.getVar(prefix + "_OS")
67 sitedata = siteinfo_data_for_machine(arch, os, d) 76 sitedata = siteinfo_data_for_machine(arch, os, d)
@@ -97,13 +106,13 @@ cpp_link_args = ${@meson_array('LDFLAGS', d)}
97gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper' 106gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper'
98 107
99[host_machine] 108[host_machine]
100system = '${HOST_OS}' 109system = '${@meson_operating_system('HOST_OS', d)}'
101cpu_family = '${@meson_cpu_family('HOST_ARCH', d)}' 110cpu_family = '${@meson_cpu_family('HOST_ARCH', d)}'
102cpu = '${HOST_ARCH}' 111cpu = '${HOST_ARCH}'
103endian = '${@meson_endian('HOST', d)}' 112endian = '${@meson_endian('HOST', d)}'
104 113
105[target_machine] 114[target_machine]
106system = '${TARGET_OS}' 115system = '${@meson_operating_system('TARGET_OS', d)}'
107cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}' 116cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}'
108cpu = '${TARGET_ARCH}' 117cpu = '${TARGET_ARCH}'
109endian = '${@meson_endian('TARGET', d)}' 118endian = '${@meson_endian('TARGET', d)}'