From 78f654ed9578b549f4ae2b9ee486be98f5a23c03 Mon Sep 17 00:00:00 2001
From: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Date: Mon, 4 Oct 2021 09:56:24 +0100
Subject: [PATCH] tests: allow cross-compiling the tests

I am trying to cross-compile from macOS for FreeBSD and this is currently
failing since the tests attempt to build a native binary that links
against the wayland-client and wayland-server libraries for the FreeBSD
system. I believe we should be building them for the target system and
not the current host (especially since there is no way to build
wayland-client and wayland-server for macOS, but I do want to check that
the files build correctly for FreeBSD).

Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Reviewed-by: Simon Ser <contact@emersion.fr>
---
 tests/meson.build | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tests/meson.build b/tests/meson.build
index 74824ae8..f994ea9d 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -21,7 +21,7 @@ endforeach
 
 # Check buildability
 
-add_languages('c', 'cpp', native: true)
+add_languages('c', 'cpp', native: false)
 replace = find_program('replace.py')
 
 foreach protocol_file : protocol_files
@@ -110,7 +110,6 @@ foreach protocol_file : protocol_files
 			'-Wall',
 			'-Werror' ],
 		install: false,
-		native: true,
 	)
 	test(test_name, pedantic_test_executable)
 
@@ -138,7 +137,6 @@ foreach protocol_file : protocol_files
 				'-Werror',
 			],
 			install: false,
-			native: true,
 		)
 		test(test_name, cxx_test_executable)
 	endif
-- 
GitLab