All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] meson: Allow source location to be configurable
@ 2021-02-27 14:49 Richard Purdie
  2021-02-27 15:45 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Richard Purdie @ 2021-02-27 14:49 UTC (permalink / raw)
  To: igt-dev

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-01  7:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-27 14:49 [igt-dev] [PATCH i-g-t] meson: Allow source location to be configurable Richard Purdie
2021-02-27 15:45 ` [igt-dev] ✓ Fi.CI.BAT: success for " 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

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.