From ebeab06747306ec16299207bf4bd7481a472b4de Mon Sep 17 00:00:00 2001
From: Changqing Li <changqing.li@windriver.com>
Date: Thu, 14 Jan 2021 06:33:04 +0000
Subject: [PATCH] tests/meson.build: use relative path to refer to files

Fix error like:
Fatal error: can't create tests/ptimer-test.p/..._qemu-5.2.0_hw_core_ptimer.c.o: File name too long

when build path is too long, use meson.source_root() will make this
filename too long. Fixed by using relative path to refer to files

Upstream-Status: Submitted [send to qemu-devel]

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 tests/unit/meson.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/unit/meson.build b/tests/unit/meson.build
index d5248ae51..2c581f055 100644
--- a/tests/unit/meson.build
+++ b/tests/unit/meson.build
@@ -127,17 +127,17 @@ endif
 
 if have_system
   tests += {
-    'ptimer-test': ['ptimer-test-stubs.c', meson.project_source_root() / 'hw/core/ptimer.c'],
+    'ptimer-test': ['ptimer-test-stubs.c', '../../hw/core/ptimer.c'],
     'test-iov': [],
     'test-opts-visitor': [testqapi],
     'test-xs-node': [qom],
-    'test-virtio-dmabuf': [meson.project_source_root() / 'hw/display/virtio-dmabuf.c'],
+    'test-virtio-dmabuf': ['../../hw/display/virtio-dmabuf.c'],
     'test-qmp-cmds': [testqapi],
     'test-xbzrle': [migration],
     'test-util-sockets': ['socket-helpers.c'],
     'test-base64': [],
     'test-bufferiszero': [],
-    'test-smp-parse': [qom, meson.project_source_root() / 'hw/core/machine-smp.c'],
+    'test-smp-parse': [qom, '../../hw/core/machine-smp.c'],
     'test-vmstate': [migration, io],
     'test-yank': ['socket-helpers.c', qom, io, chardev]
   }
