aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2020-09-06 20:28:39 +0300
committerGitHub <noreply@github.com>2020-09-06 20:28:39 +0300
commit97177bc12a98738a443cce65d9ee2bee03d0f1f3 (patch)
treee4d8394f8251ae2182ae8fe21a76d249bf148d53 /mesonbuild/backend
parent011210ee147e9786949146a618e5f565c3e76812 (diff)
parentd01fc3da8f69464eb53507ca2e33f6f887ba0e34 (diff)
downloadmeson-97177bc12a98738a443cce65d9ee2bee03d0f1f3.zip
meson-97177bc12a98738a443cce65d9ee2bee03d0f1f3.tar.gz
meson-97177bc12a98738a443cce65d9ee2bee03d0f1f3.tar.bz2
Merge pull request #7689 from scivision/fortran_inc
correct Fortran include algorithm
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r--mesonbuild/backend/ninjabackend.py42
1 files changed, 22 insertions, 20 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 7846b0d..9004165 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -543,10 +543,10 @@ int dummy;
# rule store as being wanted in compdb
for for_machine in MachineChoice:
for lang in self.environment.coredata.compilers[for_machine]:
- rules += [ "%s%s" % (rule, ext) for rule in [self.get_compiler_rule_name(lang, for_machine)]
- for ext in ['', '_RSP']]
- rules += [ "%s%s" % (rule, ext) for rule in [self.get_pch_rule_name(lang, for_machine)]
- for ext in ['', '_RSP']]
+ rules += ["%s%s" % (rule, ext) for rule in [self.get_compiler_rule_name(lang, for_machine)]
+ for ext in ['', '_RSP']]
+ rules += ["%s%s" % (rule, ext) for rule in [self.get_pch_rule_name(lang, for_machine)]
+ for ext in ['', '_RSP']]
compdb_options = ['-x'] if mesonlib.version_compare(self.ninja_version, '>=1.9') else []
ninja_compdb = self.ninja_command + ['-t', 'compdb'] + compdb_options + rules
builddir = self.environment.get_build_dir()
@@ -990,7 +990,7 @@ int dummy;
self.build.get_subproject_dir()),
self.environment.get_build_dir(),
self.environment.get_log_dir()] +
- (['--use_llvm_cov'] if use_llvm_cov else []))
+ (['--use_llvm_cov'] if use_llvm_cov else []))
def generate_coverage_rules(self):
e = NinjaBuildElement(self.all_outputs, 'meson-coverage', 'CUSTOM_COMMAND', 'PHONY')
@@ -1560,13 +1560,13 @@ int dummy;
self.get_target_dir(target))
else:
target_slashname_workaround_dir = self.get_target_dir(target)
- (rpath_args, target.rpath_dirs_to_remove) = \
- rustc.build_rpath_args(self.environment,
- self.environment.get_build_dir(),
- target_slashname_workaround_dir,
- self.determine_rpath_dirs(target),
- target.build_rpath,
- target.install_rpath)
+ rpath_args, target.rpath_dirs_to_remove = (
+ rustc.build_rpath_args(self.environment,
+ self.environment.get_build_dir(),
+ target_slashname_workaround_dir,
+ self.determine_rpath_dirs(target),
+ target.build_rpath,
+ target.install_rpath))
# ... but then add rustc's sysroot to account for rustup
# installations
for rpath_arg in rpath_args:
@@ -2777,13 +2777,13 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
self.get_target_dir(target))
else:
target_slashname_workaround_dir = self.get_target_dir(target)
- (rpath_args, target.rpath_dirs_to_remove) = \
- linker.build_rpath_args(self.environment,
- self.environment.get_build_dir(),
- target_slashname_workaround_dir,
- self.determine_rpath_dirs(target),
- target.build_rpath,
- target.install_rpath)
+ (rpath_args, target.rpath_dirs_to_remove) = (
+ linker.build_rpath_args(self.environment,
+ self.environment.get_build_dir(),
+ target_slashname_workaround_dir,
+ self.determine_rpath_dirs(target),
+ target.build_rpath,
+ target.install_rpath))
commands += rpath_args
# Add libraries generated by custom targets
custom_target_libraries = self.get_custom_target_provided_libraries(target)
@@ -3041,7 +3041,9 @@ def _scan_fortran_file_deps(src: Path, srcdir: Path, dirname: Path, tdeps, compi
# included files
incmatch = incre.match(line)
if incmatch is not None:
- incfile = srcdir / incmatch.group(1)
+ incfile = src.parent / incmatch.group(1)
+ # NOTE: src.parent is most general, in particular for CMake subproject with Fortran file
+ # having an `include 'foo.f'` statement.
if incfile.suffix.lower()[1:] in compiler.file_suffixes:
mod_files.extend(_scan_fortran_file_deps(incfile, srcdir, dirname, tdeps, compiler))
# modules