@@ -151,26 +151,13 @@ namespace printer {
151
151
declareVariableIfNotDefined (" clang" , getRelativePathWithShellVariable (
152
152
Paths::getUTBotInstallDir (), Paths::getUTBotClang ()));
153
153
declareVariableIfNotDefined (" clangpp" , stringFormat (" %s/bin/clang++" , pathToShellVariable.at (Paths::getUTBotInstallDir ())));
154
- // declareAction(stringFormat("clangpp = %s", getRelativePathWithShellVariable(
155
- // Paths::getUTBotInstallDir(), Paths::getUTBotClangPP())));
156
154
declareVariableIfNotDefined (" gcc" , Paths::getGcc ());
157
155
declareVariableIfNotDefined (" gpp" , Paths::getGpp ());
158
- //
159
- // declareVariableIfNotDefined("CC", getShellByCompiler(primaryCompiler));
160
- // declareVariableIfNotDefined("CXX", getShellByCompiler(primaryCxxCompiler));
161
156
162
157
declareVariableIfNotDefined (" ar" , Paths::getAr ());
163
158
declareVariableIfNotDefined (" ld" , Paths::getLd ());
164
159
declareVariableIfNotDefined (" ldGold" , Paths::getLdGold ());
165
160
166
- // declareVariableIfNotDefined("CxxLinker", getShellByLinker(cxxLinker));
167
-
168
- // here we possibly erase mapping of someLinker -> shellVar but we don't care since we only use
169
- // cxxLinker, primaryCompiler and primaryCxxCompiler later on for reference
170
- // pathToShellVariable[cxxLinker] = "$(CxxLinker)";
171
- // pathToShellVariable[primaryCompiler] = "$(CC)";
172
- // pathToShellVariable[{primaryCxxCompiler}] = "$(CXX)";
173
-
174
161
175
162
176
163
declareVariable (" asanLib" , Paths::getAsanLibraryPath ());
@@ -189,11 +176,11 @@ namespace printer {
189
176
declareTarget (FORCE, {}, {});
190
177
191
178
comment (" gtest" );
192
- // fs::path gtestBuildDirectory = buildDirectory / "googletest";
179
+
193
180
fs::path gtestBuildDirectory = getRelativePathWithShellVariable (buildDirectory,
194
181
buildDirectory / " googletest" );
195
182
fs::path defaultPath = " default.c" ;
196
- std::vector<std::string> defaultGtestCompileCommandLine{getShellByCompiler (primaryCxxCompiler), " -c" , " -std=c++11" ,
183
+ std::vector<std::string> defaultGtestCompileCommandLine{ getShellByCompiler (primaryCxxCompiler), " -c" , " -std=c++11" ,
197
184
FPIC_FLAG, defaultPath };
198
185
utbot::CompileCommand defaultGtestCompileCommand{ defaultGtestCompileCommandLine,
199
186
pathToShellVariable.at (buildDirectory), defaultPath };
@@ -217,14 +204,12 @@ namespace printer {
217
204
fs::path relativePath = fs::relative (file, projectContext.projectPath );
218
205
return getRelativePathWithShellVariable (buildDirectory, dependencyDirectory) /
219
206
Paths::addExtension (relativePath, " .Td" );
220
- // return dependencyDirectory / Paths::addExtension(relativePath, ".Td");
221
207
}
222
208
223
209
fs::path NativeMakefilePrinter::getDependencyFile (fs::path const &file) {
224
210
fs::path relativePath = fs::relative (file, projectContext.projectPath );
225
211
return getRelativePathWithShellVariable (buildDirectory, dependencyDirectory) /
226
212
Paths::addExtension (relativePath, " .d" );
227
- // return dependencyDirectory / Paths::addExtension(relativePath, ".d");
228
213
}
229
214
230
215
void NativeMakefilePrinter::gtestAllTargets (const utbot::CompileCommand &defaultCompileCommand,
@@ -240,7 +225,7 @@ namespace printer {
240
225
{ stringFormat (" -I%s" , getRelativePathWithShellVariable (gtestLib, gtestLib / " googletest/include" )),
241
226
stringFormat (" -I%s" , getRelativePathWithShellVariable (gtestLib, gtestLib / " googletest" )) });
242
227
243
- declareTarget (gtestAllObjectFile, {gtestCompilationArguments.getSourcePath () },
228
+ declareTarget (gtestAllObjectFile, { gtestCompilationArguments.getSourcePath () },
244
229
{ gtestCompilationArguments.toStringWithChangingDirectory () });
245
230
declareVariable (" GTEST_ALL" , gtestAllObjectFile);
246
231
@@ -328,7 +313,6 @@ namespace printer {
328
313
recompiledFile = Paths::getRecompiledFile (projectContext, pathToCompile);
329
314
buildResultType = BuildResult::Type::ALL_STUBS;
330
315
331
- // pathToCompile = getRelativePathWithShellVariable(projectContext.projectPath, pathToCompile);
332
316
} else {
333
317
if (Paths::isCXXFile (sourcePath)) {
334
318
pathToCompile = sourcePath;
@@ -338,11 +322,8 @@ namespace printer {
338
322
recompiledFile =
339
323
Paths::getRecompiledFile (projectContext, compilationUnitInfo->getOutputFile ());
340
324
buildResultType = BuildResult::Type::NO_STUBS;
341
-
342
- // pathToCompile = getRelativePathWithShellVariable(buildDirectory, pathToCompile);
343
325
}
344
326
345
- // recompiledFile = getRelativePathWithShellVariable(buildDirectory, recompiledFile);
346
327
buildResult = { recompiledFile, buildResultType};
347
328
348
329
addCompileTarget (pathToCompile, buildResult.output , *compilationUnitInfo);
@@ -436,7 +417,6 @@ namespace printer {
436
417
sharedOutput.value ().parent_path ())));
437
418
dynamicLinkCommand.addFlagToBegin (" $(LDFLAGS)" );
438
419
439
- // auto linker = pathToShellVariable.at(getLinker(cxxLinker));
440
420
auto linker = getShellByLinker (cxxLinker);
441
421
dynamicLinkCommand.setLinker (linker);
442
422
dynamicLinkCommand.setOutput (
@@ -507,7 +487,7 @@ namespace printer {
507
487
testRunCommand.addEnvironmentVariable (SanitizerUtils::ASAN_OPTIONS_NAME,
508
488
SanitizerUtils::ASAN_OPTIONS_VALUE);
509
489
510
- declareTarget (" build" , {getRelativePathWithShellVariableForProjectDirOrBuildDirOrRootDir (testExecutablePath) }, {});
490
+ declareTarget (" build" , { getRelativePathWithShellVariableForProjectDirOrBuildDirOrRootDir (testExecutablePath) }, {});
511
491
declareTarget (" run" , { " build" },
512
492
{ testRunCommand.toStringWithChangingDirectory () });
513
493
@@ -612,7 +592,6 @@ namespace printer {
612
592
}
613
593
614
594
fs::path linker = linkCommand.getLinker ();
615
- // linkCommand.setLinker(pathToShellVariable.at(getLinker(linkCommand.getLinker())));
616
595
linkCommand.setLinker (getShellByLinker (linker));
617
596
618
597
@@ -633,7 +612,7 @@ namespace printer {
633
612
});
634
613
635
614
636
- string recompiledFileRelative = getRelativePathWithShellVariableForProjectDirOrBuildDirOrRootDir (recompiledFile);
615
+ std:: string recompiledFileRelative = getRelativePathWithShellVariableForProjectDirOrBuildDirOrRootDir (recompiledFile);
637
616
std::string removeAction = stringFormat (" rm -f %s" , recompiledFileRelative);
638
617
std::vector<std::string> actions{ removeAction };
639
618
CollectionUtils::extend (actions, std::move (commandActions));
@@ -647,7 +626,7 @@ namespace printer {
647
626
auto sharedOutputRelative = getRelativePathWithShellVariableForProjectDirOrBuildDirOrRootDir (
648
627
sharedOutput.value ());
649
628
std::vector<std::string> sharedLinkCommandLine{
650
- getShellByCompiler (primaryCompiler), " $(LDFLAGS)" ,
629
+ getShellByCompiler (primaryCompiler), " $(LDFLAGS)" ,
651
630
SHARED_FLAG, coverageLinkFlags,
652
631
sanitizerLinkFlags, " -o" ,
653
632
sharedOutputRelative, " -Wl,--whole-archive" ,
0 commit comments