summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorLuca Cappa <lucappa@microsoft.com>2019-03-19 20:52:53 (GMT)
committerBrad King <brad.king@kitware.com>2019-05-14 17:27:18 (GMT)
commit2a9ff9703e20172ca14b6c872b300d0dbb75f5da (patch)
tree62541895769c282e435393895121f8573d2cdc06 /Source/cmLocalGenerator.cxx
parentfa077acba51393030586aa50f5eff9d6034c5c11 (diff)
downloadCMake-2a9ff9703e20172ca14b6c872b300d0dbb75f5da.zip
CMake-2a9ff9703e20172ca14b6c872b300d0dbb75f5da.tar.gz
CMake-2a9ff9703e20172ca14b6c872b300d0dbb75f5da.tar.bz2
MSVC: Add support for /JMC (Just My Code)
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 8b51834..047d405 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -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(