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

Method GetManagedType

Source/cmGeneratorTarget.cxx:5717–5747  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5715}
5716
5717cmGeneratorTarget::ManagedType cmGeneratorTarget::GetManagedType(
5718 std::string const& config) const
5719{
5720 // Only libraries and executables can be managed targets.
5721 if (this->GetType() > cmStateEnums::SHARED_LIBRARY) {
5722 return ManagedType::Undefined;
5723 }
5724
5725 if (this->GetType() == cmStateEnums::STATIC_LIBRARY) {
5726 return ManagedType::Native;
5727 }
5728
5729 // Check imported target.
5730 if (this->IsImported()) {
5731 if (cmGeneratorTarget::ImportInfo const* info =
5732 this->GetImportInfo(config)) {
5733 return info->Managed;
5734 }
5735 return ManagedType::Undefined;
5736 }
5737
5738 // Check for explicitly set clr target property.
5739 if (cmValue clr = this->GetProperty("COMMON_LANGUAGE_RUNTIME")) {
5740 return this->CheckManagedType(*clr);
5741 }
5742
5743 // C# targets are always managed. This language specific check
5744 // is added to avoid that the COMMON_LANGUAGE_RUNTIME target property
5745 // has to be set manually for C# targets.
5746 return this->IsCSharpOnly() ? ManagedType::Managed : ManagedType::Native;
5747}
5748
5749bool cmGeneratorTarget::AddHeaderSetVerification()
5750{

Callers 5

HasImportLibraryMethod · 0.95
AddCompileOptionsMethod · 0.80
AddLibrariesMethod · 0.80

Calls 6

GetTypeMethod · 0.95
IsImportedMethod · 0.95
GetImportInfoMethod · 0.95
GetPropertyMethod · 0.95
CheckManagedTypeMethod · 0.95
IsCSharpOnlyMethod · 0.95

Tested by

no test coverage detected