diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-02-16 18:31:32 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-02-22 06:49:34 +0530 |
commit | be486a2ec84f22052fba5ba16de136de00379966 (patch) | |
tree | 0c4a71a532fc702336fbb503af730d4bf017effd /mesonbuild/linkers.py | |
parent | feb82e0f0f365d66199d697f1d99e109e2c6a700 (diff) | |
download | meson-be486a2ec84f22052fba5ba16de136de00379966.zip meson-be486a2ec84f22052fba5ba16de136de00379966.tar.gz meson-be486a2ec84f22052fba5ba16de136de00379966.tar.bz2 |
ninjabackend: List PDBs in output list for targets
This is more correct, and forces the target(s) to be rebuilt if the
PDB files are missing. Increases the minimum required Ninja to 1.7,
which is available in Ubuntu 16.04 under backports.
We can't do the same for import libraries, because it is impossible
for us to know at configure time whether or not an import library will
be generated for a given DLL.
Diffstat (limited to 'mesonbuild/linkers.py')
-rw-r--r-- | mesonbuild/linkers.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py index 9781813..b1d80c3 100644 --- a/mesonbuild/linkers.py +++ b/mesonbuild/linkers.py @@ -75,6 +75,9 @@ class StaticLinker: def native_args_to_unix(cls, args: T.List[str]) -> T.List[str]: return args[:] + def get_link_debugfile_name(self, targetfile: str) -> str: + return None + def get_link_debugfile_args(self, targetfile: str) -> T.List[str]: # Static libraries do not have PDB files return [] @@ -305,6 +308,10 @@ class DynamicLinker(metaclass=abc.ABCMeta): m = 'Language {} does not support has_multi_link_arguments.' raise mesonlib.EnvironmentException(m.format(self.id)) + def get_debugfile_name(self, targetfile: str) -> str: + '''Name of debug file written out (see below)''' + return None + def get_debugfile_args(self, targetfile: str) -> T.List[str]: """Some compilers (MSVC) write debug into a separate file. @@ -812,10 +819,12 @@ class VisualStudioLikeLinkerMixin: def get_std_shared_lib_args(self) -> T.List[str]: return self._apply_prefix('/DLL') + def get_debugfile_name(self, targetfile: str) -> str: + basename = targetfile.rsplit('.', maxsplit=1)[0] + return basename + '.pdb' + def get_debugfile_args(self, targetfile: str) -> T.List[str]: - pdbarr = targetfile.split('.')[:-1] - pdbarr += ['pdb'] - return self._apply_prefix(['/DEBUG', '/PDB:' + '.'.join(pdbarr)]) + return self._apply_prefix(['/DEBUG', '/PDB:' + self.get_debugfile_name(targetfile)]) def get_link_whole_for(self, args: T.List[str]) -> T.List[str]: # Only since VS2015 |