aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/backend/ninjabackend.py32
-rw-r--r--test cases/windows/7 mingw dll versioning/installed_files.txt2
-rw-r--r--test cases/windows/7 mingw dll versioning/meson.build4
-rw-r--r--test cases/windows/8 msvc dll versioning/installed_files.txt2
-rw-r--r--test cases/windows/8 msvc dll versioning/meson.build4
5 files changed, 32 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:]):
diff --git a/test cases/windows/7 mingw dll versioning/installed_files.txt b/test cases/windows/7 mingw dll versioning/installed_files.txt
index ebad9e4..f02b454 100644
--- a/test cases/windows/7 mingw dll versioning/installed_files.txt
+++ b/test cases/windows/7 mingw dll versioning/installed_files.txt
@@ -6,3 +6,5 @@ usr/bin/libonlyversion-1.dll
usr/lib/libonlyversion.dll.a
usr/bin/libonlysoversion-5.dll
usr/lib/libonlysoversion.dll.a
+usr/libexec/libcustomdir.dll
+usr/libexec/libcustomdir.dll.a
diff --git a/test cases/windows/7 mingw dll versioning/meson.build b/test cases/windows/7 mingw dll versioning/meson.build
index d1fe73a..7f65532 100644
--- a/test cases/windows/7 mingw dll versioning/meson.build
+++ b/test cases/windows/7 mingw dll versioning/meson.build
@@ -47,3 +47,7 @@ test('manually linked 3', executable('manuallink3', out,
test('manually linked 4', executable('manuallink4', out,
link_args : ['-L.', '-lonlysoversion']))
+
+shared_library('customdir', 'lib.c',
+ install : true,
+ install_dir : get_option('libexecdir'))
diff --git a/test cases/windows/8 msvc dll versioning/installed_files.txt b/test cases/windows/8 msvc dll versioning/installed_files.txt
index ae0fa1f..1a735e2 100644
--- a/test cases/windows/8 msvc dll versioning/installed_files.txt
+++ b/test cases/windows/8 msvc dll versioning/installed_files.txt
@@ -8,3 +8,5 @@ usr/bin/onlyversion-1.dll
usr/lib/onlyversion.lib
usr/bin/onlysoversion-5.dll
usr/lib/onlysoversion.lib
+usr/libexec/customdir.dll
+usr/libexec/customdir.lib
diff --git a/test cases/windows/8 msvc dll versioning/meson.build b/test cases/windows/8 msvc dll versioning/meson.build
index b72c5ec..eea41d9 100644
--- a/test cases/windows/8 msvc dll versioning/meson.build
+++ b/test cases/windows/8 msvc dll versioning/meson.build
@@ -48,3 +48,7 @@ test('manually linked 3', executable('manuallink3', out,
test('manually linked 4', executable('manuallink4', out,
link_args : ['-L.', '-lonlysoversion']))
+
+shared_library('customdir', 'lib.c',
+ install : true,
+ install_dir : get_option('libexecdir'))