From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] meson: Allow source location to be configurable
Date: Sat, 27 Feb 2021 14:49:00 +0000 [thread overview]
Message-ID: <20210227144900.3961632-1-richard.purdie@linuxfoundation.org> (raw)
Hardcoding a build source path into a binary when cross compiling isn't
appropriate and breaks build reproducibility. Allow the srcdir to be
specified by an optional configuration option to meson.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
lib/meson.build | 6 +++++-
meson_options.txt | 4 ++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/meson.build b/lib/meson.build
index 114eadde..672b4206 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -125,7 +125,11 @@ if chamelium.found()
lib_sources += 'igt_chamelium_stream.c'
endif
-srcdir = join_paths(meson.source_root(), 'tests')
+if get_option('srcdir') != ''
+ srcdir = join_paths(get_option('srcdir'), 'tests')
+else
+ srcdir = join_paths(meson.source_root(), 'tests')
+endif
lib_version = vcs_tag(input : 'version.h.in', output : 'version.h',
fallback : 'NO-GIT',
diff --git a/meson_options.txt b/meson_options.txt
index ff3abf08..a0a1aaed 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -50,3 +50,7 @@ option('use_rpath',
type : 'boolean',
value : false,
description : 'Set runpath on installed executables for libigt.so')
+
+option('srcdir',
+ type : 'string',
+ description : 'Path to source code to be compiled into binaries (optional)')
--
2.27.0
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next reply other threads:[~2021-02-27 14:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-27 14:49 Richard Purdie [this message]
2021-02-27 15:45 ` [igt-dev] ✓ Fi.CI.BAT: success for meson: Allow source location to be configurable Patchwork
2021-02-27 17:26 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-02-28 10:06 ` [igt-dev] [PATCH i-g-t] " Martin Peres
2021-02-28 12:29 ` Richard Purdie
2021-03-01 6:43 ` Martin Peres
2021-03-01 7:30 ` Petri Latvala
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210227144900.3961632-1-richard.purdie@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.