diff options
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/meson.bbclass | 13 |
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 | ||
67 | def meson_operating_system(var, d): | ||
68 | os = d.getVar(var) | ||
69 | if "mingw" in os: | ||
70 | return "windows" | ||
71 | else: | ||
72 | return os | ||
73 | |||
65 | def meson_endian(prefix, d): | 74 | def 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)} | |||
97 | gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper' | 106 | gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper' |
98 | 107 | ||
99 | [host_machine] | 108 | [host_machine] |
100 | system = '${HOST_OS}' | 109 | system = '${@meson_operating_system('HOST_OS', d)}' |
101 | cpu_family = '${@meson_cpu_family('HOST_ARCH', d)}' | 110 | cpu_family = '${@meson_cpu_family('HOST_ARCH', d)}' |
102 | cpu = '${HOST_ARCH}' | 111 | cpu = '${HOST_ARCH}' |
103 | endian = '${@meson_endian('HOST', d)}' | 112 | endian = '${@meson_endian('HOST', d)}' |
104 | 113 | ||
105 | [target_machine] | 114 | [target_machine] |
106 | system = '${TARGET_OS}' | 115 | system = '${@meson_operating_system('TARGET_OS', d)}' |
107 | cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}' | 116 | cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}' |
108 | cpu = '${TARGET_ARCH}' | 117 | cpu = '${TARGET_ARCH}' |
109 | endian = '${@meson_endian('TARGET', d)}' | 118 | endian = '${@meson_endian('TARGET', d)}' |