aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-07-13 22:18:50 +0300
committerGitHub <noreply@github.com>2016-07-13 22:18:50 +0300
commit64919b1c7463d2adceec961350f33707cae9718b (patch)
tree1be6f8d33b822ab20d443fdde18a107f3b45c5a6 /mesonbuild/backend/backends.py
parent38a896ae5154b54865db57bbd8f3ddc69a8083ba (diff)
parentf8d75883724e115083bff1befa75def42be282c5 (diff)
downloadmeson-64919b1c7463d2adceec961350f33707cae9718b.zip
meson-64919b1c7463d2adceec961350f33707cae9718b.tar.gz
meson-64919b1c7463d2adceec961350f33707cae9718b.tar.bz2
Merge pull request #417 from nirbheek/dll-paths
Fix filenames and paths used in DLL shared library generation
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index fcc3d3b..d2693b2 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -110,9 +110,13 @@ class Backend():
# On some platforms (msvc for instance), the file that is used for
# dynamic linking is not the same as the dynamic library itself. This
# file is called an import library, and we want to link against that.
- # On platforms where this distinction is not important, the import
- # library is the same as the dynamic library itself.
- return os.path.join(self.get_target_dir(target), target.get_import_filename())
+ # On all other platforms, we link to the library directly.
+ if isinstance(target, build.SharedLibrary):
+ link_lib = target.get_import_filename() or target.get_filename()
+ return os.path.join(self.get_target_dir(target), link_lib)
+ elif isinstance(target, build.StaticLibrary):
+ return os.path.join(self.get_target_dir(target), target.get_filename())
+ raise AssertionError('BUG: Tried to link to something that\'s not a library')
def get_target_dir(self, target):
if self.environment.coredata.get_builtin_option('layout') == 'mirror':
@@ -496,11 +500,19 @@ class Backend():
if isinstance(i, build.Executable):
cmd += self.exe_object_to_cmd_array(i)
continue
- if isinstance(i, build.CustomTarget):
+ elif isinstance(i, build.CustomTarget):
# GIR scanner will attempt to execute this binary but
# it assumes that it is in path, so always give it a full path.
tmp = i.get_filename()[0]
i = os.path.join(self.get_target_dir(i), tmp)
+ elif isinstance(i, mesonlib.File):
+ i = os.path.join(i.subdir, i.fname)
+ if absolute_paths:
+ i = os.path.join(self.environment.get_build_dir(), i)
+ # FIXME: str types are blindly added and ignore the 'absolute_paths' argument
+ elif not isinstance(i, str):
+ err_msg = 'Argument {0} is of unknown type {1}'
+ raise RuntimeError(err_msg.format(str(i), str(type(i))))
for (j, src) in enumerate(srcs):
i = i.replace('@INPUT%d@' % j, src)
for (j, res) in enumerate(ofilenames):