From 13820ace3f7e34e45e4d4c2dc4f9302c39d733aa Mon Sep 17 00:00:00 2001 From: Kichin Egor Date: Thu, 17 Nov 2022 15:14:51 +0300 Subject: [PATCH 1/2] Add source file in UTBot test`s Makefiles dependencies --- server/src/printers/NativeMakefilePrinter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/printers/NativeMakefilePrinter.cpp b/server/src/printers/NativeMakefilePrinter.cpp index 17dede56a..901fd4e17 100644 --- a/server/src/printers/NativeMakefilePrinter.cpp +++ b/server/src/printers/NativeMakefilePrinter.cpp @@ -271,7 +271,7 @@ namespace printer { std::string postCompileAction = stringFormat("mv -f %s %s", temporaryDependencyFile, dependencyFile); - declareTarget(compileCommand.getOutput(), { compileCommand.getSourcePath(), dependencyFile }, + declareTarget(compileCommand.getOutput(), { compileCommand.getSourcePath(), dependencyFile, compilationUnitInfo.command.getSourcePath() }, { makingDependencyDirectory, compileCommand.toStringWithChangingDirectoryToNew( getRelativePath(compileCommand.getDirectory())), From f639176444044b4e1f4e2ea493093b11a306de2f Mon Sep 17 00:00:00 2001 From: Kichin Egor Date: Thu, 17 Nov 2022 17:02:57 +0300 Subject: [PATCH 2/2] Make source path relative. --- server/src/printers/NativeMakefilePrinter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/printers/NativeMakefilePrinter.cpp b/server/src/printers/NativeMakefilePrinter.cpp index 901fd4e17..e54c2f287 100644 --- a/server/src/printers/NativeMakefilePrinter.cpp +++ b/server/src/printers/NativeMakefilePrinter.cpp @@ -271,7 +271,9 @@ namespace printer { std::string postCompileAction = stringFormat("mv -f %s %s", temporaryDependencyFile, dependencyFile); - declareTarget(compileCommand.getOutput(), { compileCommand.getSourcePath(), dependencyFile, compilationUnitInfo.command.getSourcePath() }, + auto source = getRelativePath(compilationUnitInfo.command.getSourcePath()); + + declareTarget(compileCommand.getOutput(), { compileCommand.getSourcePath(), dependencyFile, source }, { makingDependencyDirectory, compileCommand.toStringWithChangingDirectoryToNew( getRelativePath(compileCommand.getDirectory())),