MCPcopy Create free account
hub / github.com/Kitware/CMake / OutputPreprocessorDefinitions

Method OutputPreprocessorDefinitions

Source/cmVisualStudioGeneratorOptions.cxx:353–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351}
352
353void cmVisualStudioGeneratorOptions::OutputPreprocessorDefinitions(
354 std::ostream& fout, int indent, std::string const& lang)
355{
356 if (this->Defines.empty()) {
357 return;
358 }
359 std::string tag = "PreprocessorDefinitions";
360 if (lang == "CUDA"_s) {
361 tag = "Defines";
362 }
363
364 std::ostringstream oss;
365 if (!this->LocalGenerator->IsVFProj()) {
366 oss << "%(" << tag << ')';
367 }
368 auto de = cmRemoveDuplicates(this->Defines);
369 for (std::string const& di : cmMakeRange(this->Defines.cbegin(), de)) {
370 std::string define;
371 if (!this->LocalGenerator->IsVFProj()) {
372 // Escape the definition for MSBuild.
373 define = di;
374 cmVS10EscapeForMSBuild(define);
375 if (lang == "RC"_s) {
376 cmSystemTools::ReplaceString(define, "\"", "\\\"");
377 }
378 } else {
379 // Escape the definition for the compiler.
380 define = this->LocalGenerator->EscapeForShell(di, true);
381 }
382 // Store the flag in the project file.
383 oss << ';' << define;
384 }
385
386 this->OutputFlag(fout, indent, tag, oss.str());
387}
388
389void cmVisualStudioGeneratorOptions::OutputAdditionalIncludeDirectories(
390 std::ostream& fout, int indent, std::string const& lang)

Callers 2

WriteConfigurationMethod · 0.45
WriteGroupMethod · 0.45

Calls 9

cmRemoveDuplicatesFunction · 0.85
cmMakeRangeFunction · 0.85
cmVS10EscapeForMSBuildFunction · 0.85
IsVFProjMethod · 0.80
cbeginMethod · 0.80
EscapeForShellMethod · 0.80
strMethod · 0.80
emptyMethod · 0.45
OutputFlagMethod · 0.45

Tested by

no test coverage detected