diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-03-14 15:15:13 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-04-04 14:59:13 +0530 |
commit | 98b1ce1cd9f3220ec6a06ef2bfa122518a9245ed (patch) | |
tree | 348afc99358b63938b5a63b395489b74573c1ec8 /mesonbuild/backend/ninjabackend.py | |
parent | 57cb1f9aad0928e167018ba886e2d8c06225b515 (diff) | |
download | meson-98b1ce1cd9f3220ec6a06ef2bfa122518a9245ed.zip meson-98b1ce1cd9f3220ec6a06ef2bfa122518a9245ed.tar.gz meson-98b1ce1cd9f3220ec6a06ef2bfa122518a9245ed.tar.bz2 |
Fix custom directory installation of import library
When install_dir was set for a shared_library, the import library
would not be installed at all, which is unintended.
Instead, install it into the custom directory if it is set, otherwise
install it in the default import library installation directory.
Includes a test for this.
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 77b2d1d..464cdcb 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -632,23 +632,13 @@ int dummy; should_strip = self.get_option_for_target('strip', t) # Find the installation directory. outdirs = t.get_custom_install_dir() + custom_install_dir = False if outdirs[0] is not None and outdirs[0] is not True: # Either the value is set, or is set to False which means # we want this specific output out of many outputs to not # be installed. - pass + custom_install_dir = True elif isinstance(t, build.SharedLibrary): - # On toolchains/platforms that use an import library for - # linking (separate from the shared library with all the - # code), we need to install that too (dll.a/.lib). - if t.get_import_filename(): - # Install the import library. - i = [self.get_target_filename_for_linking(t), - self.environment.get_import_lib_dir(), - # It has no aliases, should not be stripped, and - # doesn't have an install_rpath - {}, False, ''] - d.targets.append(i) outdirs[0] = self.environment.get_shared_lib_dir() elif isinstance(t, build.StaticLibrary): outdirs[0] = self.environment.get_static_lib_dir() @@ -672,6 +662,24 @@ int dummy; i = [self.get_target_filename(t), outdirs[0], t.get_aliases(), should_strip, t.install_rpath] d.targets.append(i) + # On toolchains/platforms that use an import library for + # linking (separate from the shared library with all the + # code), we need to install that too (dll.a/.lib). + if isinstance(t, build.SharedLibrary) and t.get_import_filename(): + if custom_install_dir: + # If the DLL is installed into a custom directory, + # install the import library into the same place so + # it doesn't go into a surprising place + implib_install_dir = outdirs[0] + else: + implib_install_dir = self.environment.get_import_lib_dir() + # Install the import library. + i = [self.get_target_filename_for_linking(t), + implib_install_dir, + # It has no aliases, should not be stripped, and + # doesn't have an install_rpath + {}, False, ''] + d.targets.append(i) # Install secondary outputs. Only used for Vala right now. if num_outdirs > 1: for output, outdir in zip(t.get_outputs()[1:], outdirs[1:]): |