diff options
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 15 | ||||
-rw-r--r-- | mesonbuild/dependencies/dev.py | 2 | ||||
-rw-r--r-- | mesonbuild/dependencies/misc.py | 6 | ||||
-rw-r--r-- | mesonbuild/scripts/gettext.py | 5 |
4 files changed, 17 insertions, 11 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 2e6e351..bb281e1 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1131,9 +1131,13 @@ int dummy; # file is outside the build directory, the path components will be # stripped and just the basename will be used. if isinstance(gensrc, (build.CustomTarget, build.GeneratedList)) or gensrc.is_built: - vala_c_file = os.path.splitext(vala_file)[0] + '.c' - else: vala_c_file = os.path.splitext(os.path.basename(vala_file))[0] + '.c' + else: + path_to_target = os.path.join(self.build_to_src, target.get_subdir()) + if vala_file.startswith(path_to_target): + vala_c_file = os.path.splitext(os.path.relpath(vala_file, path_to_target))[0] + '.c' + else: + vala_c_file = os.path.splitext(os.path.basename(vala_file))[0] + '.c' # All this will be placed inside the c_out_dir vala_c_file = os.path.join(c_out_dir, vala_c_file) vala_c_src.append(vala_c_file) @@ -1144,13 +1148,14 @@ int dummy; # Tell Valac to output everything in our private directory. Sadly this # means it will also preserve the directory components of Vala sources # found inside the build tree (generated sources). - args += ['-d', c_out_dir] + args += ['--directory', c_out_dir] + args += ['--basedir', os.path.join(self.build_to_src, target.get_subdir())] if not isinstance(target, build.Executable): # Library name - args += ['--library=' + target.name] + args += ['--library', target.name] # Outputted header hname = os.path.join(self.get_target_dir(target), target.vala_header) - args += ['-H', hname] + args += ['--header', hname] if self.is_unity(target): # Without this the declarations will get duplicated in the .c # files and cause a build failure when all of them are diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py index 387300a..b0e54c6 100644 --- a/mesonbuild/dependencies/dev.py +++ b/mesonbuild/dependencies/dev.py @@ -169,7 +169,7 @@ class LLVMDependency(ExternalDependency): self.version = out.strip().rstrip('svn') p, out = Popen_safe( - [self.llvmconfig, '--libs', '--ldflags', '--system-libs'])[:2] + [self.llvmconfig, '--libs', '--ldflags'])[:2] if p.returncode != 0: raise DependencyException('Could not generate libs for LLVM.') self.link_args = shlex.split(out) diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index a0d5e47..e00897d 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -82,9 +82,6 @@ class BoostDependency(ExternalDependency): if 'BOOST_LIBRARYDIR' in os.environ: self.libdir = os.environ['BOOST_LIBRARYDIR'] - if self.want_cross and self.boost_root is None and self.incdir is None: - raise DependencyException('BOOST_ROOT or BOOST_INCLUDEDIR is needed while cross-compiling') - if self.boost_root is None: if mesonlib.is_windows(): self.boost_roots = self.detect_win_roots() @@ -131,7 +128,8 @@ class BoostDependency(ExternalDependency): mlog.log('Dependency Boost (%s) found:' % module_str, mlog.green('YES'), info) def detect_nix_roots(self): - return ['/usr/local', '/usr'] + return [os.path.abspath(os.path.join(x, '..')) + for x in self.compiler.get_default_include_dirs()] def detect_win_roots(self): res = [] diff --git a/mesonbuild/scripts/gettext.py b/mesonbuild/scripts/gettext.py index ef4f42a..30ac54c 100644 --- a/mesonbuild/scripts/gettext.py +++ b/mesonbuild/scripts/gettext.py @@ -70,7 +70,10 @@ def update_po(src_sub, pkgname, langs): potfile = os.path.join(src_sub, pkgname + '.pot') for l in langs: pofile = os.path.join(src_sub, l + '.po') - subprocess.check_call(['msgmerge', '-q', '-o', pofile, pofile, potfile]) + if os.path.exists(pofile): + subprocess.check_call(['msgmerge', '-q', '-o', pofile, pofile, potfile]) + else: + subprocess.check_call(['msginit', '--input', potfile, '--output-file', pofile, '--locale', l, '--no-translator']) return 0 def do_install(src_sub, bld_sub, dest, pkgname, langs): |