aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2018-06-02 18:24:53 +0100
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2018-06-03 20:57:03 +0000
commitd78fa6ffe396b7e34847ae63771d053d9cbc4339 (patch)
treef3a00e610a5a974f059acd52a7466284d9d956f4
parent8e8d3231ad99496146bf011b1b6ce269a9461130 (diff)
downloadmeson-d78fa6ffe396b7e34847ae63771d053d9cbc4339.zip
meson-d78fa6ffe396b7e34847ae63771d053d9cbc4339.tar.gz
meson-d78fa6ffe396b7e34847ae63771d053d9cbc4339.tar.bz2
Install implib where expected if default install_dir: is explicitly given
Install the implib into the default import lib directory if an explicit install_dir: is given, but the value happens to be the same as the default.
-rw-r--r--mesonbuild/backend/ninjabackend.py30
-rw-r--r--test cases/windows/12 exe implib/meson.build2
2 files changed, 18 insertions, 14 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 1aff06f..e9892b4 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -698,25 +698,29 @@ int dummy;
if not t.should_install():
continue
# 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.
- custom_install_dir = True
- elif isinstance(t, build.SharedModule):
- outdirs[0] = self.environment.get_shared_module_dir()
+ if isinstance(t, build.SharedModule):
+ default_install_dir = self.environment.get_shared_module_dir()
elif isinstance(t, build.SharedLibrary):
- outdirs[0] = self.environment.get_shared_lib_dir()
+ default_install_dir = self.environment.get_shared_lib_dir()
elif isinstance(t, build.StaticLibrary):
- outdirs[0] = self.environment.get_static_lib_dir()
+ default_install_dir = self.environment.get_static_lib_dir()
elif isinstance(t, build.Executable):
- outdirs[0] = self.environment.get_bindir()
+ default_install_dir = self.environment.get_bindir()
+ elif isinstance(t, build.CustomTarget):
+ default_install_dir = None
else:
assert(isinstance(t, build.BuildTarget))
# XXX: Add BuildTarget-specific install dir cases here
- outdirs[0] = self.environment.get_libdir()
+ default_install_dir = self.environment.get_libdir()
+ outdirs = t.get_custom_install_dir()
+ if outdirs[0] is not None and outdirs[0] != default_install_dir and outdirs[0] is not True:
+ # Either the value is set to a non-default value, or is set to
+ # False (which means we want this specific output out of many
+ # outputs to not be installed).
+ custom_install_dir = True
+ else:
+ custom_install_dir = False
+ outdirs[0] = default_install_dir
# Sanity-check the outputs and install_dirs
num_outdirs, num_out = len(outdirs), len(t.get_outputs())
if num_outdirs != 1 and num_outdirs != num_out:
diff --git a/test cases/windows/12 exe implib/meson.build b/test cases/windows/12 exe implib/meson.build
index 2526c65..0a38ec1 100644
--- a/test cases/windows/12 exe implib/meson.build
+++ b/test cases/windows/12 exe implib/meson.build
@@ -4,4 +4,4 @@ project('wintest', 'c')
# name can be set, and that it is installed along with the executable
executable('prog', 'prog.c', install: true, implib: true)
-executable('prog2', 'prog.c', install: true, implib: 'burble')
+executable('prog2', 'prog.c', install: true, implib: 'burble', install_dir: get_option('bindir'))