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

Method cmLocalVisualStudio7GeneratorFCInfo

Source/cmLocalVisualStudio7Generator.cxx:1472–1624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1470};
1471
1472cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo(
1473 cmLocalVisualStudio7Generator* lg, cmGeneratorTarget* gt,
1474 cmGeneratorTarget::AllConfigSource const& acs,
1475 std::vector<std::string> const& configs)
1476{
1477 cmSourceFile const& sf = *acs.Source;
1478 std::string objectName;
1479 if (gt->HasExplicitObjectName(&sf)) {
1480 objectName = gt->GetObjectName(&sf);
1481 }
1482
1483 // Compute per-source, per-config information.
1484 size_t ci = 0;
1485 for (std::string const& config : configs) {
1486 std::string configUpper = cmSystemTools::UpperCase(config);
1487 cmLVS7GFileConfig fc;
1488
1489 std::string lang = std::string(
1490 lg->GlobalGenerator->GetLanguageFromExtension(sf.GetExtension()));
1491 std::string const& sourceLang = lg->GetSourceFileLanguage(sf);
1492 bool needForceLang = false;
1493 // source file does not match its extension language
1494 if (lang != sourceLang) {
1495 needForceLang = true;
1496 lang = sourceLang;
1497 }
1498
1499 cmGeneratorExpressionInterpreter genexInterpreter(lg, config, gt, lang);
1500
1501 bool needfc = false;
1502 if (!objectName.empty()) {
1503 fc.ObjectName = objectName;
1504 needfc = true;
1505 }
1506 std::string const COMPILE_FLAGS("COMPILE_FLAGS");
1507 if (cmValue cflags = sf.GetProperty(COMPILE_FLAGS)) {
1508 fc.CompileFlags = genexInterpreter.Evaluate(*cflags, COMPILE_FLAGS);
1509 needfc = true;
1510 }
1511 std::string const COMPILE_OPTIONS("COMPILE_OPTIONS");
1512 if (cmValue coptions = sf.GetProperty(COMPILE_OPTIONS)) {
1513 lg->AppendCompileOptions(
1514 fc.CompileFlags,
1515 genexInterpreter.Evaluate(*coptions, COMPILE_OPTIONS));
1516 needfc = true;
1517 }
1518 // Add precompile headers compile options.
1519 std::string const pchSource = gt->GetPchSource(config, lang);
1520 if (!pchSource.empty() && !sf.GetProperty("SKIP_PRECOMPILE_HEADERS")) {
1521 std::string pchOptions;
1522 if (sf.GetFullPath() == pchSource) {
1523 pchOptions = gt->GetPchCreateCompileOptions(config, lang);
1524 } else {
1525 pchOptions = gt->GetPchUseCompileOptions(config, lang);
1526 }
1527
1528 lg->AppendCompileOptions(
1529 fc.CompileFlags,

Callers

nothing calls this directly

Calls 15

HasExplicitObjectNameMethod · 0.80
GetExtensionMethod · 0.80
GetSourceFileLanguageMethod · 0.80
AppendCompileOptionsMethod · 0.80
GetPchSourceMethod · 0.80
to_stringMethod · 0.80
cmStrCatFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected