summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2017-09-27 11:17:15 -0700
committerEric Anholt <eric@anholt.net>2017-10-03 11:56:57 -0700
commit2a74ae550842cfe216bff28725e1a24db3b56792 (patch)
tree28e912b0ee681d34c3dc92457f0d01934bb9cac3
parentb09047edeeab8584649e2c7ebded28dace3f6853 (diff)
meson: Fix build of igt_x86-using tests on non-x86 platforms.
Just stub out the features return value, and return an empty string. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
-rw-r--r--lib/igt_x86.h12
-rw-r--r--lib/meson.build5
2 files changed, 16 insertions, 1 deletions
diff --git a/lib/igt_x86.h b/lib/igt_x86.h
index 589d224b..d6dcfa10 100644
--- a/lib/igt_x86.h
+++ b/lib/igt_x86.h
@@ -40,7 +40,19 @@
#define AVX 0x80
#define AVX2 0x100
+#if defined(__x86_64__)
unsigned igt_x86_features(void);
char *igt_x86_features_to_string(unsigned features, char *line);
+#else
+static inline unsigned igt_x86_features(void)
+{
+ return 0;
+}
+static inline char *igt_x86_features_to_string(unsigned features, char *line)
+{
+ line[0] = 0;
+ return line;
+}
+#endif
#endif /* IGT_X86_H */
diff --git a/lib/meson.build b/lib/meson.build
index 54ff4f9b..42919eef 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -55,7 +55,6 @@ lib_sources = [
'igt_rand.c',
'igt_stats.c',
'igt_sysfs.c',
- 'igt_x86.c',
'igt_vgem.c',
'instdone.c',
'intel_batchbuffer.c',
@@ -89,6 +88,10 @@ lib_sources = [
'igt_kmod.c',
]
+if ['x86', 'x86_64'].contains(host_machine.cpu_family())
+ lib_sources += 'igt_x86.c'
+endif
+
lib_deps = [
cairo,
glib,