[vte] build: Add option to disable -Bsymbolic-functions



commit 347f7dd9b1c11244156bfb593866306c735cb06a
Author: Christian Persch <chpe src gnome org>
Date:   Sun Oct 13 21:30:49 2019 +0200

    build: Add option to disable -Bsymbolic-functions
    
    Fixes: https://gitlab.gnome.org/GNOME/vte/issues/184

 meson.build       | 16 +++++++++++-----
 meson_options.txt |  9 +++++++++
 2 files changed, 20 insertions(+), 5 deletions(-)
---
diff --git a/meson.build b/meson.build
index a479f10f..06294595 100644
--- a/meson.build
+++ b/meson.build
@@ -372,15 +372,21 @@ add_project_arguments(global_cxxflags, language: 'cpp')
 # Linker flags
 
 linker_flags = [
-  '-Wl,-Bsymbolic-functions'
+  [ '-Wl,-Bsymbolic-functions', get_option('_b_symbolic_functions'),],
 ]
 
 foreach flag: linker_flags
-  assert(cc.has_link_argument(flag), flag + ' is required but not supported')
-  add_project_link_arguments(flag, language: 'c')
+  if cc.has_link_argument(flag[0])
+    add_project_link_arguments(flag[0], language: 'c')
+  elif flag[1]
+    assert(false, flag[0] + ' is required but not supported')
+  endif
 
-  assert(cxx.has_link_argument(flag), flag + ' is required but not supported')
-  add_project_link_arguments(flag, language: 'cpp')
+  if cxx.has_link_argument(flag[0])
+    add_project_link_arguments(flag[0], language: 'cpp')
+  elif flag[1]
+    assert(false, flag[0] + ' is required but not supported')
+  endif
 endforeach
 
 # Dependencies
diff --git a/meson_options.txt b/meson_options.txt
index d29c66a3..5d8c8798 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -13,6 +13,15 @@
 # You should have received a copy of the GNU Lesser General Public License
 # along with this library.  If not, see <https://www.gnu.org/licenses/>.
 
+# This option allows you to disable -Bsymbolic-functions if your linker
+# doesn't support it.
+option(
+  '_b_symbolic_functions',
+  type: 'boolean',
+  value: true,
+  description: 'Use -Bsymbolic-functions',
+)
+
 option(
   'debugg', # for some reason, 'debug' is "reserved"
   type: 'boolean',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]