Merge topic 'msvc-jmc'

2a9ff9703e MSVC: Add support for /JMC (Just My Code)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3121
This commit is contained in:
Brad King
2019-05-15 18:06:36 +00:00
committed by Kitware Robot
13 changed files with 137 additions and 1 deletions
+26
View File
@@ -877,6 +877,32 @@ void cmLocalGenerator::AddCompileOptions(std::string& flags,
}
}
this->AddCompilerRequirementFlag(flags, target, lang);
// Add compile flag for the MSVC compiler only.
cmMakefile* mf = this->GetMakefile();
if (const char* jmc =
mf->GetDefinition("CMAKE_" + lang + "_COMPILE_OPTIONS_JMC")) {
// Handle Just My Code debugging flags, /JMC.
// If the target is a Managed C++ one, /JMC is not compatible.
if (target->GetManagedType(config) !=
cmGeneratorTarget::ManagedType::Managed) {
// add /JMC flags if target property VS_JUST_MY_CODE_DEBUGGING is set
// to ON
if (char const* jmcExprGen =
target->GetProperty("VS_JUST_MY_CODE_DEBUGGING")) {
cmGeneratorExpression ge;
std::unique_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(jmcExprGen);
std::string isJMCEnabled = cge->Evaluate(this, config);
if (cmSystemTools::IsOn(isJMCEnabled)) {
std::vector<std::string> optVec;
cmSystemTools::ExpandListArgument(jmc, optVec);
this->AppendCompileOptions(flags, optVec);
}
}
}
}
}
std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectoriesImplicit(
+1
View File
@@ -335,6 +335,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
InitProperty("LINK_SEARCH_START_STATIC", nullptr);
InitProperty("LINK_SEARCH_END_STATIC", nullptr);
InitProperty("FOLDER", nullptr);
InitProperty("VS_JUST_MY_CODE_DEBUGGING", nullptr);
#ifdef __APPLE__
if (this->GetGlobalGenerator()->IsXcode()) {
InitProperty("XCODE_GENERATE_SCHEME", nullptr);