[babl/wip/msvc: 2/20] babl/meson.build: Check for GCC-style linker flags accordingly



commit 2bf3f12be8d48b28e7e3896e81bab54e3c1e7caf
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Jan 17 15:30:33 2020 +0800

    babl/meson.build: Check for GCC-style linker flags accordingly
    
    We don't want to check for these linker flags, as they do not work,
    on MSVC builds.

 babl/meson.build | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/babl/meson.build b/babl/meson.build
index 542bb622a..ffe36a5a7 100644
--- a/babl/meson.build
+++ b/babl/meson.build
@@ -30,16 +30,20 @@ babl_c_args = [
 ]
 
 # Linker arguments
-if cc.links('', name: '-Wl,--version-script', args: ['-shared', '-Wl,--version-script=' + babl_gnu_sym_path])
-  babl_link_args = ['-Wl,--version-script,' + version_script]
-elif host_machine.system() == 'darwin' and cc.has_multi_link_arguments('-Wl,-exported_symbols_list', 
babl_clang_sym_path)
-  # Clang on Darwin
-  babl_link_args = ['-Wl,-exported_symbols_list',version_script_clang]
+if cc.get_id() != 'msvc'
+  if cc.links('', name: '-Wl,--version-script', args: ['-shared', '-Wl,--version-script=' + 
babl_gnu_sym_path])
+    babl_link_args = ['-Wl,--version-script,' + version_script]
+  elif host_machine.system() == 'darwin' and cc.has_multi_link_arguments('-Wl,-exported_symbols_list', 
babl_clang_sym_path)
+    # Clang on Darwin
+    babl_link_args = ['-Wl,-exported_symbols_list',version_script_clang]
+  else
+    error('Linker doesn\'t support --version-script or -exported_symbols_list')
+  endif
+  if platform_win32
+    babl_link_args += '-Wl,--no-undefined'
+  endif
 else
-  error('Linker doesn\'t support --version-script or -exported_symbols_list')
-endif
-if platform_win32
-  babl_link_args += '-Wl,--no-undefined'
+  babl_link_args= []
 endif
 
 


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