diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2018-10-19 14:15:51 -0700 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2019-07-23 09:58:24 +0000 |
commit | 24c4c079e7e4b94af9659299e730a6970eb8a648 (patch) | |
tree | b1002c133acf973108768f930f6aab99da241f8f | |
parent | 7eb1d89095054286391565a23c6a4d27465dd617 (diff) | |
download | meson-24c4c079e7e4b94af9659299e730a6970eb8a648.zip meson-24c4c079e7e4b94af9659299e730a6970eb8a648.tar.gz meson-24c4c079e7e4b94af9659299e730a6970eb8a648.tar.bz2 |
linkers: Add get_base_link_args method to static linkers
MSVC needs an argument to static linkers for doing LTO, so we need a way
for the static linker to tell us that.
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 4 | ||||
-rw-r--r-- | mesonbuild/linkers.py | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index ce5565f..cc601d8 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -2467,7 +2467,9 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) # Add linker args for linking this target derived from 'base' build # options passed on the command-line, in default_options, etc. # These have the lowest priority. - if not isinstance(target, build.StaticLibrary): + if isinstance(target, build.StaticLibrary): + commands += linker.get_base_link_args(self.get_base_options_for_target(target)) + else: commands += compilers.get_base_link_args(self.get_base_options_for_target(target), linker, isinstance(target, build.SharedModule)) diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py index 20b513a..9529cb7 100644 --- a/mesonbuild/linkers.py +++ b/mesonbuild/linkers.py @@ -33,6 +33,10 @@ class StaticLinker: """ return mesonlib.is_windows() + def get_base_link_args(self, options: 'OptionDictType') -> typing.List[str]: + """Like compilers.get_base_link_args, but for the static linker.""" + return [] + def get_exelist(self) -> typing.List[str]: return self.exelist.copy() |