diff mbox series

meson: map the system property in the cross file

Message ID 20191220171513.1140-1-ross.burton@intel.com
State Superseded
Headers show
Series meson: map the system property in the cross file | expand

Commit Message

Ross Burton Dec. 20, 2019, 5:15 p.m. UTC
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>

---
 meta/classes/meson.bbclass | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

-- 
2.20.1

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass
index e1a13bbbf74..9e7ce42a701 100644
--- a/meta/classes/meson.bbclass
+++ b/meta/classes/meson.bbclass
@@ -62,6 +62,16 @@  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):
+    import re
+    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 +107,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)}'