Skip to content

Commit 9216114

Browse files
authored
Fix recursive BUILD_DIR in test makefile (#410)
1 parent 70703b6 commit 9216114

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

server/src/printers/RelativeMakefilePrinter.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,12 @@ void RelativeMakefilePrinter::declareShellVariable(const std::string& variableNa
6464

6565
std::string RelativeMakefilePrinter::getProjectStructureRelativeTo(fs::path path) const {
6666
DefaultMakefilePrinter printer;
67-
printer.declareVariable("export PROJECT_DIR_RELATIVE_TO_MAKEFILE",
68-
fs::relative(projectPath, path));
67+
printer.declareVariable("export PROJECT_DIR_RELATIVE_TO_MAKEFILE", fs::relative(projectPath, path));
6968
// magic spell from https://stackoverflow.com/questions/18136918/how-to-get-current-relative-directory-of-your-makefile
7069
printer.declareVariable("export MAKEFILE_DIR", "$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))");
71-
printer.declareVariable("export PROJECT_DIR",
72-
StringUtils::stringFormat("%s/%s", "$(MAKEFILE_DIR)", "$(PROJECT_DIR_RELATIVE_TO_MAKEFILE)"));
70+
printer.declareVariable("export PROJECT_DIR", "$(MAKEFILE_DIR)/$(PROJECT_DIR_RELATIVE_TO_MAKEFILE)");
7371
printer.declareVariable("export BUILD_RELATIVE", buildDirectoryRelative);
74-
printer.declareVariable("export BUILD_DIR", StringUtils::stringFormat("%s/%s",
75-
getRelativePath(projectPath),
76-
getRelativePath(buildDirectoryRelative)));
72+
printer.declareVariable("export BUILD_DIR", "$(PROJECT_DIR)/$(BUILD_RELATIVE)");
7773
return printer.ss.str();
7874
}
7975

0 commit comments

Comments
 (0)