diff options
author | Ross Burton <ross.burton@intel.com> | 2019-12-20 14:57:35 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-12-28 23:25:42 +0000 |
commit | f6a35934540e910794b8729ecc278189a39b710f (patch) | |
tree | fc8b6fd4a3c1099abcaaeff9efbea54d69e86c38 /meta/classes/meson.bbclass | |
parent | 9fd5fb85468dac57d3b7f9d872ad9cea21ca9e77 (diff) | |
download | poky-f6a35934540e910794b8729ecc278189a39b710f.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'.
(From OE-Core rev: f408bbb1cc72b84905b22d100f52c0a9f54ff3fe)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/meson.bbclass')
-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)}' |