From 3bf207ab1bb85ffd6bc35acbbf63609a33928ed6 Mon Sep 17 00:00:00 2001 From: Remi Thebault Date: Sun, 28 Feb 2021 19:29:29 +0100 Subject: D add build dir to -J switch --- mesonbuild/compilers/d.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py index eac2aa7..4a6a046 100644 --- a/mesonbuild/compilers/d.py +++ b/mesonbuild/compilers/d.py @@ -220,13 +220,15 @@ class DmdLikeCompilerMixin(CompilerMixinBase): for idir_obj in import_dirs: basedir = idir_obj.get_curdir() for idir in idir_obj.get_incdirs(): + bldtreedir = os.path.join(basedir, idir) # Avoid superfluous '/.' at the end of paths when d is '.' if idir not in ('', '.'): - expdir = os.path.join(basedir, idir) + expdir = bldtreedir else: expdir = basedir srctreedir = os.path.join(build_to_src, expdir) res.append('{0}{1}'.format(import_dir_arg, srctreedir)) + res.append('{0}{1}'.format(import_dir_arg, bldtreedir)) if kwargs: raise EnvironmentException('Unknown D compiler feature(s) selected: %s' % ', '.join(kwargs.keys())) @@ -592,13 +594,15 @@ class DCompiler(Compiler): for idir_obj in import_dirs: basedir = idir_obj.get_curdir() for idir in idir_obj.get_incdirs(): + bldtreedir = os.path.join(basedir, idir) # Avoid superfluous '/.' at the end of paths when d is '.' if idir not in ('', '.'): - expdir = os.path.join(basedir, idir) + expdir = bldtreedir else: expdir = basedir srctreedir = os.path.join(build_to_src, expdir) res.append('{0}{1}'.format(import_dir_arg, srctreedir)) + res.append('{0}{1}'.format(import_dir_arg, bldtreedir)) if kwargs: raise EnvironmentException('Unknown D compiler feature(s) selected: %s' % ', '.join(kwargs.keys())) -- cgit v1.1