diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-07-21 22:19:07 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-07-21 22:19:07 +0300 |
commit | bff37a90fc475c6204087dcf1ccb6734b990141e (patch) | |
tree | d228c8107a4daf66e76f3d0fa4a03e5e689c55e9 /mesonbuild/compilers | |
parent | 328a1f30fdfdadc6d5df4ebfc075e9cd5c0df96e (diff) | |
parent | e82edc179fe86e68d1f74fe084fd891ef2d12316 (diff) | |
download | meson-bff37a90fc475c6204087dcf1ccb6734b990141e.zip meson-bff37a90fc475c6204087dcf1ccb6734b990141e.tar.gz meson-bff37a90fc475c6204087dcf1ccb6734b990141e.tar.bz2 |
Merged buildrpath branch.
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r-- | mesonbuild/compilers/c.py | 6 | ||||
-rw-r--r-- | mesonbuild/compilers/compilers.py | 7 | ||||
-rw-r--r-- | mesonbuild/compilers/cs.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/d.py | 8 | ||||
-rw-r--r-- | mesonbuild/compilers/fortran.py | 4 | ||||
-rw-r--r-- | mesonbuild/compilers/java.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/rust.py | 4 |
7 files changed, 19 insertions, 14 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 593366a..d93c7cc 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -87,8 +87,8 @@ class CCompiler(Compiler): return None, fname # The default behavior is this, override in MSVC - def build_rpath_args(self, build_dir, from_dir, rpath_paths, install_rpath): - return self.build_unix_rpath_args(build_dir, from_dir, rpath_paths, install_rpath) + def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath): + return self.build_unix_rpath_args(build_dir, from_dir, rpath_paths, build_rpath, install_rpath) def get_dependency_gen_args(self, outtarget, outfile): return ['-MMD', '-MQ', outtarget, '-MF', outfile] @@ -909,7 +909,7 @@ class VisualStudioCCompiler(CCompiler): "The name of the outputted import library" return ['/IMPLIB:' + implibname] - def build_rpath_args(self, build_dir, from_dir, rpath_paths, install_rpath): + def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath): return [] # FIXME, no idea what these should be. diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 252db72..72e1ed3 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -798,8 +798,8 @@ class Compiler: def get_instruction_set_args(self, instruction_set): return None - def build_unix_rpath_args(self, build_dir, from_dir, rpath_paths, install_rpath): - if not rpath_paths and not install_rpath: + def build_unix_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath): + if not rpath_paths and not install_rpath and not build_rpath: return [] # The rpaths we write must be relative, because otherwise # they have different length depending on the build @@ -812,6 +812,9 @@ class Compiler: relative = os.path.relpath(os.path.join(build_dir, p), os.path.join(build_dir, from_dir)) rel_rpaths.append(relative) paths = ':'.join([os.path.join('$ORIGIN', p) for p in rel_rpaths]) + # Build_rpath is used as-is (it is usually absolute). + if build_rpath != '': + paths += ':' + build_rpath if len(paths) < len(install_rpath): padding = 'X' * (len(install_rpath) - len(paths)) if not paths: diff --git a/mesonbuild/compilers/cs.py b/mesonbuild/compilers/cs.py index e6c5b9e..b8a4d13 100644 --- a/mesonbuild/compilers/cs.py +++ b/mesonbuild/compilers/cs.py @@ -43,7 +43,7 @@ class MonoCompiler(Compiler): def split_shlib_to_parts(self, fname): return None, fname - def build_rpath_args(self, build_dir, from_dir, rpath_paths, install_rpath): + def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath): return [] def get_dependency_gen_args(self, outtarget, outfile): diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py index e1d534f..a989704 100644 --- a/mesonbuild/compilers/d.py +++ b/mesonbuild/compilers/d.py @@ -88,12 +88,14 @@ class DCompiler(Compiler): def get_std_exe_link_args(self): return [] - def build_rpath_args(self, build_dir, from_dir, rpath_paths, install_rpath): + def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath): # This method is to be used by LDC and DMD. # GDC can deal with the verbatim flags. if not rpath_paths and not install_rpath: return [] paths = ':'.join([os.path.join(build_dir, p) for p in rpath_paths]) + if build_rpath != '': + paths += ':' + build_rpath if len(paths) < len(install_rpath): padding = 'X' * (len(install_rpath) - len(paths)) if not paths: @@ -212,8 +214,8 @@ class GnuDCompiler(DCompiler): def get_buildtype_args(self, buildtype): return d_gdc_buildtype_args[buildtype] - def build_rpath_args(self, build_dir, from_dir, rpath_paths, install_rpath): - return self.build_unix_rpath_args(build_dir, from_dir, rpath_paths, install_rpath) + def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath): + return self.build_unix_rpath_args(build_dir, from_dir, rpath_paths, build_rpath, install_rpath) def get_unittest_args(self): return ['-funittest'] diff --git a/mesonbuild/compilers/fortran.py b/mesonbuild/compilers/fortran.py index d44b529..e17cda0 100644 --- a/mesonbuild/compilers/fortran.py +++ b/mesonbuild/compilers/fortran.py @@ -132,8 +132,8 @@ end program prog def get_std_exe_link_args(self): return [] - def build_rpath_args(self, build_dir, from_dir, rpath_paths, install_rpath): - return self.build_unix_rpath_args(build_dir, from_dir, rpath_paths, install_rpath) + def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath): + return self.build_unix_rpath_args(build_dir, from_dir, rpath_paths, build_rpath, install_rpath) def module_name_to_filename(self, module_name): return module_name.lower() + '.mod' diff --git a/mesonbuild/compilers/java.py b/mesonbuild/compilers/java.py index 0253bfe..a8138d7 100644 --- a/mesonbuild/compilers/java.py +++ b/mesonbuild/compilers/java.py @@ -34,7 +34,7 @@ class JavaCompiler(Compiler): def split_shlib_to_parts(self, fname): return None, fname - def build_rpath_args(self, build_dir, from_dir, rpath_paths, install_rpath): + def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath): return [] def get_dependency_gen_args(self, outtarget, outfile): diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index 38ba6a2..b93289f 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -50,8 +50,8 @@ class RustCompiler(Compiler): def get_buildtype_args(self, buildtype): return rust_buildtype_args[buildtype] - def build_rpath_args(self, build_dir, from_dir, rpath_paths, install_rpath): - return self.build_unix_rpath_args(build_dir, from_dir, rpath_paths, install_rpath) + def build_rpath_args(self, build_dir, from_dir, rpath_paths, build_rpath, install_rpath): + return self.build_unix_rpath_args(build_dir, from_dir, rpath_paths, build_rpath, install_rpath) def get_sysroot(self): cmd = self.exelist + ['--print', 'sysroot'] |