@@ -29,9 +29,15 @@ import std.string;
2929
3030class DubLintGenerator : ProjectGenerator
3131{
32- this (Project project)
32+ private
33+ {
34+ NativePath m_cwd;
35+ }
36+
37+ this (Project project, NativePath cwd)
3338 {
3439 super (project);
40+ m_cwd = cwd;
3541 }
3642
3743 override void generateTargets (GeneratorSettings settings, in TargetInfo[string ] targets)
@@ -48,14 +54,12 @@ class DubLintGenerator : ProjectGenerator
4854 private void performDirectBuild (GeneratorSettings settings,
4955 ref BuildSettings buildsettings, in Package pack, string config)
5056 {
51- auto cwd = NativePath(getcwd());
52-
5357 tracef(" %s %s: building configuration %s" , pack.name, pack.version_, config);
5458
5559 // make all target/import paths relative
5660 string makeRelative (string path)
5761 {
58- return shrinkPath (NativePath(path), cwd );
62+ return shrinkPath (NativePath(path), m_cwd );
5963 }
6064
6165 buildsettings.targetPath = makeRelative(buildsettings.targetPath);
@@ -81,11 +85,13 @@ class DubLintGenerator : ProjectGenerator
8185 buildsettings.lflags = null ;
8286 buildsettings.addOptions(BuildOption.syntaxOnly);
8387 buildsettings.sourceFiles = buildsettings.sourceFiles.filter! (f => ! isLinkerFile(settings.platform, f)).array;
84- trace(" Build settings: " , buildsettings);
8588
8689 settings.compiler.prepareBuildSettings(buildsettings, settings.platform, BuildSetting.commandLine);
8790
88- settings.compiler.invoke(buildsettings, settings.platform, settings.compileCallback);
91+ static if (is (typeof (settings.toolWorkingDirectory)))
92+ settings.compiler.invoke(buildsettings, settings.platform, settings.compileCallback, settings.toolWorkingDirectory);
93+ else
94+ settings.compiler.invoke(buildsettings, settings.platform, settings.compileCallback);
8995 }
9096}
9197
0 commit comments