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

Method GetCodeLiteCompilerName

Source/cmExtraCodeLiteGenerator.cxx:585–609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

583}
584
585std::string cmExtraCodeLiteGenerator::GetCodeLiteCompilerName(
586 cmMakefile const* mf) const
587{
588 // figure out which language to use
589 // for now care only for C and C++
590 std::string compilerIdVar = "CMAKE_CXX_COMPILER_ID";
591 if (!this->GlobalGenerator->GetLanguageEnabled("CXX")) {
592 compilerIdVar = "CMAKE_C_COMPILER_ID";
593 }
594
595 std::string const& compilerId = mf->GetSafeDefinition(compilerIdVar);
596 std::string compiler = "gnu g++"; // default to g++
597
598 // Since we need the compiler for parsing purposes only
599 // it does not matter if we use clang or clang++, same as
600 // "gnu gcc" vs "gnu g++"
601 if (compilerId == "MSVC") {
602 compiler = "VC++";
603 } else if (compilerId == "Clang") {
604 compiler = "clang++";
605 } else if (compilerId == "GNU") {
606 compiler = "gnu g++";
607 }
608 return compiler;
609}
610
611std::string cmExtraCodeLiteGenerator::GetConfigurationName(
612 cmMakefile const* mf) const

Callers 1

Calls 1

GetLanguageEnabledMethod · 0.45

Tested by

no test coverage detected