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

Method HaveCxxModuleSupport

Source/cmGeneratorTarget.cxx:6178–6208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6176}
6177
6178cmGeneratorTarget::Cxx20SupportLevel cmGeneratorTarget::HaveCxxModuleSupport(
6179 std::string const& config) const
6180{
6181 auto const* state = this->Makefile->GetState();
6182 if (!state->GetLanguageEnabled("CXX")) {
6183 return Cxx20SupportLevel::MissingCxx;
6184 }
6185
6186 cmValue standardDefault =
6187 this->Makefile->GetDefinition("CMAKE_CXX_STANDARD_DEFAULT");
6188 if (!standardDefault || standardDefault->empty()) {
6189 // We do not know any meaningful C++ standard levels for this compiler.
6190 return Cxx20SupportLevel::NoCxx20;
6191 }
6192
6193 cmStandardLevelResolver standardResolver(this->Makefile);
6194 cmStandardLevel const cxxStd20 =
6195 *standardResolver.LanguageStandardLevel("CXX", "20");
6196 cm::optional<cmStandardLevel> explicitLevel =
6197 this->GetExplicitStandardLevel("CXX", config);
6198 if (!explicitLevel || *explicitLevel < cxxStd20) {
6199 return Cxx20SupportLevel::NoCxx20;
6200 }
6201
6202 cmValue scandepRule =
6203 this->Makefile->GetDefinition("CMAKE_CXX_SCANDEP_SOURCE");
6204 if (!scandepRule) {
6205 return Cxx20SupportLevel::MissingRule;
6206 }
6207 return Cxx20SupportLevel::Supported;
6208}
6209
6210void cmGeneratorTarget::CheckCxxModuleStatus(std::string const& config) const
6211{

Callers 6

ApplyCXXStdTargetsMethod · 0.95
CheckCxxModuleStatusMethod · 0.95
NeedCxxModuleSupportMethod · 0.95
NeedCxxDyndepMethod · 0.95
ComputeMethod · 0.80

Calls 6

GetStateMethod · 0.45
GetLanguageEnabledMethod · 0.45
GetDefinitionMethod · 0.45
emptyMethod · 0.45
LanguageStandardLevelMethod · 0.45

Tested by

no test coverage detected