From f13887b64a9d535682668960493158ae15bfbb2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20No=C3=ABl?= Date: Tue, 3 Oct 2017 18:25:07 +0200 Subject: Reduce code complexity, fix nested array in files instruction --- mesonbuild/backend/ninjabackend.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'mesonbuild/backend/ninjabackend.py') 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 -- cgit v1.1