meson: make nm binary optional
authorDylan Baker <dylan@pnwbakers.com>
Thu, 17 May 2018 20:44:30 +0000 (13:44 -0700)
committerDylan Baker <dylan@pnwbakers.com>
Fri, 3 May 2019 17:58:05 +0000 (10:58 -0700)
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

Reviewed-by: Eric Anholt <eric@anholt.net>
meson.build
src/egl/meson.build
src/gbm/meson.build
src/mapi/es1api/meson.build
src/mapi/es2api/meson.build

index 87ce5f7872e3e3a56572c2f4acd954275a0b7c9b..f72bdc946bfbb5bcc873dfdc7e71f784ab3be900 100644 (file)
@@ -1502,8 +1502,11 @@ endif
 
 pkg = import('pkgconfig')
 
 
 pkg = import('pkgconfig')
 
+prog_nm = find_program('nm', required : false)
 env_test = environment()
 env_test = environment()
-env_test.set('NM', find_program('nm').path())
+if prog_nm.found()
+  env_test.set('NM', prog_nm.path())
+endif
 
 # This quirk needs to be applied to sources with functions defined in assembly
 # as GCC LTO drops them. See: https://bugs.freedesktop.org/show_bug.cgi?id=109391
 
 # This quirk needs to be applied to sources with functions defined in assembly
 # as GCC LTO drops them. See: https://bugs.freedesktop.org/show_bug.cgi?id=109391
index 38ffb512f1ce09f6e31d03282fac08d7c68a3abf..3a0fd01d244b9cb8cd655c88b60a10b5ddf959b0 100644 (file)
@@ -192,7 +192,7 @@ pkg.generate(
   extra_cflags : gl_pkgconfig_c_flags,
 )
 
   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
   if with_glvnd
     # TODO: add glvnd symbol check
   else
index b2ad66735926fc33881375b16ebe3d594ee91f6c..b7262c5980240638d89bedbee037e65bb1b95f68 100644 (file)
@@ -66,7 +66,7 @@ pkg.generate(
   libraries_private : '-ldl',  # FIXME: autotools lists this a incomplete
 )
 
   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'),
   test(
     'gbm-symbols-check',
     find_program('gbm-symbols-check'),
index 8e9587e35802f0c4dd55deec48c1eebbb7c2758c..53bdc16d94694476c93fa81976abe28db5e6798c 100644 (file)
@@ -52,7 +52,7 @@ pkg.generate(
   libraries_private : gl_priv_libs,
 )
 
   libraries_private : gl_priv_libs,
 )
 
-if with_tests
+if with_tests and prog_nm.found()
   test(
     'es1-ABI-check',
     find_program('ABI-check'),
   test(
     'es1-ABI-check',
     find_program('ABI-check'),
index 5b2c52b024dec16dfc54f4c79dc4cb74b75035a2..d374bd8084994ff7ea49c46a7a20484199798af2 100644 (file)
@@ -52,7 +52,7 @@ pkg.generate(
   libraries_private : gl_priv_libs,
 )
 
   libraries_private : gl_priv_libs,
 )
 
-if with_tests
+if with_tests and prog_nm.found()
   test(
     'es2-ABI-check',
     find_program('ABI-check'),
   test(
     'es2-ABI-check',
     find_program('ABI-check'),