diff options
author | Corentin Noël <corentin@elementary.io> | 2017-10-03 18:25:07 +0200 |
---|---|---|
committer | Corentin Noël <corentin@elementary.io> | 2017-10-03 18:25:07 +0200 |
commit | f13887b64a9d535682668960493158ae15bfbb2d (patch) | |
tree | a407a1d5cf9802aa9aa87f64792c0fa6695606fa /mesonbuild/backend/ninjabackend.py | |
parent | ac8d5f215640179c6135a87f1e089587ae7fb102 (diff) | |
download | meson-f13887b64a9d535682668960493158ae15bfbb2d.zip meson-f13887b64a9d535682668960493158ae15bfbb2d.tar.gz meson-f13887b64a9d535682668960493158ae15bfbb2d.tar.bz2 |
Reduce code complexity, fix nested array in files instruction
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index e00dd5e..5d02991 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1133,10 +1133,9 @@ int dummy; if isinstance(gensrc, (build.CustomTarget, build.GeneratedList)) or gensrc.is_built: vala_c_file = os.path.splitext(os.path.basename(vala_file))[0] + '.c' else: - realpath = os.path.abspath(os.path.join(self.environment.get_build_dir(), vala_file)) - if (realpath.startswith(os.path.join(self.environment.get_source_dir(), target.get_subdir()))): - relpath = os.path.relpath(realpath, os.path.join(self.environment.get_source_dir(), target.get_subdir())) - vala_c_file = os.path.join(os.path.dirname(relpath), os.path.splitext(os.path.basename(vala_file))[0] + '.c') + 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 |