diff mbox series

meson: support for custom nm path

Message ID 20190806091925.6558-1-andi@dri-devel.l.notmuch.email (mailing list archive)
State New, archived
Headers show
Series meson: support for custom nm path | expand

Commit Message

andi@dri-devel.l.notmuch.email Aug. 6, 2019, 9:19 a.m. UTC
From: Jörg Thalheim <joerg@thalheim.io>

When cross-compiling target toolchains i.e. binutils are often
prefixed by its target architecture. This patch gives the user
to option to specify the nm used during the build process.

Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
---
 meson.build       | 2 +-
 meson_options.txt | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meson.build b/meson.build
index e292554a..64607139 100644
--- a/meson.build
+++ b/meson.build
@@ -327,7 +327,7 @@  pkg.generate(
 )
 
 env_test = environment()
-env_test.set('NM', find_program('nm').path())
+env_test.set('NM', find_program(get_option('nm-path')).path())
 
 if with_libkms
   subdir('libkms')
diff --git a/meson_options.txt b/meson_options.txt
index 8af33f1c..b4f46a52 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -141,3 +141,9 @@  option(
   value : false,
   description : 'Enable support for using udev instead of mknod.',
 )
+option(
+  'nm-path',
+  type : 'string',
+  description : 'path to nm',
+  value : 'nm'
+)