[babl] build: only check for link arg --no-undefined once



commit 7831ddbfe8792587e157814ef5f59eec8ceba2dd
Author: John Marshall <jtm home gmail com>
Date:   Wed Jun 24 16:45:10 2020 +0100

    build: only check for link arg --no-undefined once

 babl/meson.build       | 5 ++---
 extensions/meson.build | 4 ++--
 meson.build            | 8 ++++++++
 3 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/babl/meson.build b/babl/meson.build
index 89fa6988f..931a43013 100644
--- a/babl/meson.build
+++ b/babl/meson.build
@@ -45,11 +45,10 @@ elif cc.get_id() == 'clang'
 else
   error('Linker doesn\'t support --version-script or -exported_symbols_list')
 endif
-if platform_win32 and cc.has_link_argument('-Wl,--no-undefined')
-  babl_link_args += '-Wl,--no-undefined'
+if platform_win32
+  babl_link_args += no_undefined
 endif
 
-
 babl_version_h = configure_file(
   input:  'babl-version.h.in',
   output: 'babl-version.h',
diff --git a/extensions/meson.build b/extensions/meson.build
index c25471811..850793f75 100644
--- a/extensions/meson.build
+++ b/extensions/meson.build
@@ -17,8 +17,8 @@ babl_ext_inc = [
 # Linker arguments
 babl_ext_link_args = [
 ]
-if platform_win32 and cc.has_link_argument('-Wl,--no-undefined')
-  babl_ext_link_args += '-Wl,--no-undefined'
+if platform_win32
+  babl_ext_link_args += no_undefined
 endif
 
 
diff --git a/meson.build b/meson.build
index 814906f02..e8b908ddc 100644
--- a/meson.build
+++ b/meson.build
@@ -167,6 +167,14 @@ common_c_flags += cc.get_supported_arguments(extra_warnings_list)
 
 add_project_arguments(common_c_flags, language: 'c')
 
+# Linker arguments
+if platform_win32 and cc.has_link_argument('-Wl,--no-undefined')
+  no_undefined = '-Wl,--no-undefined'
+else
+  no_undefined = []
+endif
+
+
 ################################################################################
 # Check for compiler CPU extensions
 


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