[gjs/meson.msvc: 4/8] meson.build: Don't use GCC-specific linker flags on MSVC
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/meson.msvc: 4/8] meson.build: Don't use GCC-specific linker flags on MSVC
- Date: Fri, 25 Oct 2019 07:39:32 +0000 (UTC)
commit 9546cde551e6cfb58f4f4423b54afdc3c2971b49
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Fri Oct 25 12:43:32 2019 +0800
meson.build: Don't use GCC-specific linker flags on MSVC
The notion of a symbols map and list file do not apply here on MSVC, as
we use __declspec(dllexport) to export the symbols. Also, don't check
for GCC-specific -Wl,... flags on MSVC builds.
meson.build | 35 +++++++++++++++++++++--------------
1 file changed, 21 insertions(+), 14 deletions(-)
---
diff --git a/meson.build b/meson.build
index ec6f819e..7263fbe3 100644
--- a/meson.build
+++ b/meson.build
@@ -485,21 +485,28 @@ if build_profiler
libgjs_dependencies += profiler_deps
endif
-symbol_map = files('libgjs.map')
-symbol_list = files('libgjs.symbols')
-link_args = cxx.get_supported_link_arguments([
- '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(),
- symbol_map[0]),
- '-Wl,-exported_symbols_list,@0@/@1@'.format(meson.current_source_dir(),
- symbol_list[0]), # macOS linker
-])
-
-if cxx.has_link_argument('-Wl,-no-undefined')
- link_args += '-Wl,-no-undefined'
+if cxx.get_id() == 'msvc'
+ # We use __declspec(dllexport) on MSVC builds.
+ symbol_map = []
+ symbol_list = []
+ link_args = []
else
- # -undefined error is the equivalent of -no-undefined for the macOS linker,
- # but -undefined would also be understood as a valid argument for GNU ld!
- link_args += cxx.get_supported_link_arguments('-Wl,-undefined,error')
+ symbol_map = files('libgjs.map')
+ symbol_list = files('libgjs.symbols')
+ link_args = cxx.get_supported_link_arguments([
+ '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(),
+ symbol_map[0]),
+ '-Wl,-exported_symbols_list,@0@/@1@'.format(meson.current_source_dir(),
+ symbol_list[0]), # macOS linker
+ ])
+
+ if cxx.has_link_argument('-Wl,-no-undefined')
+ link_args += '-Wl,-no-undefined'
+ else
+ # -undefined error is the equivalent of -no-undefined for the macOS linker,
+ # but -undefined would also be understood as a valid argument for GNU ld!
+ link_args += cxx.get_supported_link_arguments('-Wl,-undefined,error')
+ endif
endif
extra_libgjs_cpp_args = []
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]