summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2019-12-20 14:57:35 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-12-28 23:25:35 +0000
commitf408bbb1cc72b84905b22d100f52c0a9f54ff3fe (patch)
tree0e127ac35ba82c1361b3c4e13c540a9ea699c830 /meta/classes
parentdd9c3d042aa5c2ae0fd80b558ec7e9c793ff36f0 (diff)
downloadopenembedded-core-f408bbb1cc72b84905b22d100f52c0a9f54ff3fe.tar.gz
meson: map the system property in the cross file
We can't just use HOST_OS, as in meta-mingw SDKs that is 'mingw32' but Meson expects 'windows'. Signed-off-by: Ross Burton <ross.burton@intel.com>
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):
else:
return arch
+# Map our OS values to what Meson expects:
+# https://mesonbuild.com/Reference-tables.html#operating-system-names
+def meson_operating_system(var, d):
+ os = d.getVar(var)
+ if "mingw" in os:
+ return "windows"
+ else:
+ return os
+
def meson_endian(prefix, d):
arch, os = d.getVar(prefix + "_ARCH"), d.getVar(prefix + "_OS")
sitedata = siteinfo_data_for_machine(arch, os, d)
@@ -97,13 +106,13 @@ cpp_link_args = ${@meson_array('LDFLAGS', d)}
gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper'
[host_machine]
-system = '${HOST_OS}'
+system = '${@meson_operating_system('HOST_OS', d)}'
cpu_family = '${@meson_cpu_family('HOST_ARCH', d)}'
cpu = '${HOST_ARCH}'
endian = '${@meson_endian('HOST', d)}'
[target_machine]
-system = '${TARGET_OS}'
+system = '${@meson_operating_system('TARGET_OS', d)}'
cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}'
cpu = '${TARGET_ARCH}'
endian = '${@meson_endian('TARGET', d)}'