From 3605255a8e6eabd20490e784f9535ee540c1d079 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 14 Apr 2019 06:20:40 +0200 Subject: Use full path for source files in ninja, to make file links work with vscode and other tools --- backend/ninja/Ninja.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'backend/ninja') diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp index c594722..f5c92a4 100644 --- a/backend/ninja/Ninja.cpp +++ b/backend/ninja/Ninja.cpp @@ -1187,9 +1187,9 @@ namespace backend ninja::NinjaArgValue zigHeaderFileValue = { zigHeaderFile, '"' + toUtf8(zigHeaderFileDir) + '/' + headerName + '"' }; ninja::NinjaBuild *ninjaBuild = nullptr; if(zigTest) - ninjaBuild = testZigRule->build("../../../" + sourceFile.filepath, objectName, { zigHeaderFileValue }); + ninjaBuild = testZigRule->build(projectPathUtf8 + "/" + sourceFile.filepath, objectName, { zigHeaderFileValue }); else - ninjaBuild = compileZigRule->build("../../../" + sourceFile.filepath, objectName, { zigHeaderFileValue }); + ninjaBuild = compileZigRule->build(projectPathUtf8 + "/" + sourceFile.filepath, objectName, { zigHeaderFileValue }); ninjaBuild->alwaysRun = true; zigBuilds.push_back(ninjaBuild); @@ -1209,7 +1209,7 @@ namespace backend { objectName += config.getPackageName() + "@exe/" + sourceFile.filepath; objectName += getObjectFileExtension(config.getCompiler()); - compileCRule->build("../../../" + sourceFile.filepath, objectName, {}, zigBuilds); + compileCRule->build(projectPathUtf8 + "/" + sourceFile.filepath, objectName, {}, zigBuilds); usesCFiles = true; break; } @@ -1217,7 +1217,7 @@ namespace backend { objectName += config.getPackageName() + "@exe/" + sourceFile.filepath; objectName += getObjectFileExtension(config.getCompiler()); - compileCppRule->build("../../../" + sourceFile.filepath, objectName, {}, zigBuilds); + compileCppRule->build(projectPathUtf8 + "/" + sourceFile.filepath, objectName, {}, zigBuilds); usesCppFiles = true; break; } -- cgit v1.2.3