[Mesa-dev] [PATCH v4 29/49] meson: make nm binary optional

Dylan Baker dylan at pnwbakers.com
Wed Aug 22 17:04:52 UTC 2018


This makes nm not required, but used if found. In general I imagine that
this means that on windows nm wont be found, and on other platforms it
will.

v2: - fix gbm and egl symbols check tests to only be run if nm is found
    - reword commit message to reflect the code change
---
 meson.build                 | 5 ++++-
 src/egl/meson.build         | 2 +-
 src/gbm/meson.build         | 2 +-
 src/mapi/es1api/meson.build | 2 +-
 src/mapi/es2api/meson.build | 2 +-
 5 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/meson.build b/meson.build
index c5baaf60c68..05a03f687cd 100644
--- a/meson.build
+++ b/meson.build
@@ -1586,8 +1586,11 @@ endif
 
 pkg = import('pkgconfig')
 
+prog_nm = find_program('nm', required : false)
 env_test = environment()
-env_test.set('NM', find_program('nm').path())
+if prog_nm.found()
+  env_test.set('NM', prog_nm.path())
+endif
 
 subdir('include')
 subdir('bin')
diff --git a/src/egl/meson.build b/src/egl/meson.build
index c7c22d36371..b6bbcfccd77 100644
--- a/src/egl/meson.build
+++ b/src/egl/meson.build
@@ -194,7 +194,7 @@ pkg.generate(
   extra_cflags : gl_pkgconfig_c_flags,
 )
 
-if with_tests
+if with_tests and prog_nm.found()
   if with_glvnd
     # TODO: add glvnd symbol check
   else
diff --git a/src/gbm/meson.build b/src/gbm/meson.build
index 2e9d380c0b4..97516dfbc6c 100644
--- a/src/gbm/meson.build
+++ b/src/gbm/meson.build
@@ -68,7 +68,7 @@ pkg.generate(
   libraries_private : '-ldl',  # FIXME: autotools lists this a incomplete
 )
 
-if with_tests
+if with_tests and prog_nm.found()
   test(
     'gbm-symbols-check',
     find_program('gbm-symbols-check'),
diff --git a/src/mapi/es1api/meson.build b/src/mapi/es1api/meson.build
index 32b7cc3eaee..74cd69b8130 100644
--- a/src/mapi/es1api/meson.build
+++ b/src/mapi/es1api/meson.build
@@ -59,7 +59,7 @@ pkg.generate(
   libraries_private : gl_priv_libs,
 )
 
-if with_tests
+if with_tests and prog_nm.found()
   test(
     'es1-ABI-check',
     find_program('ABI-check'),
diff --git a/src/mapi/es2api/meson.build b/src/mapi/es2api/meson.build
index 9e847e6e077..04cde895f89 100644
--- a/src/mapi/es2api/meson.build
+++ b/src/mapi/es2api/meson.build
@@ -59,7 +59,7 @@ pkg.generate(
   libraries_private : gl_priv_libs,
 )
 
-if with_tests
+if with_tests and prog_nm.found()
   test(
     'es2-ABI-check',
     find_program('ABI-check'),
-- 
2.18.0



More information about the mesa-dev mailing list