summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-05-15 18:06:36 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-05-15 18:06:58 (GMT)
commit9ee24ede7363f8349c876e2f1dbbc541f60e3452 (patch)
tree1b868e346e2fc06077d5d1c8f1f64b8a8cf1126d /Source/cmLocalGenerator.cxx
parent66efdbd21a46b63572f5de677ed126a68e524e7a (diff)
parent2a9ff9703e20172ca14b6c872b300d0dbb75f5da (diff)
downloadCMake-9ee24ede7363f8349c876e2f1dbbc541f60e3452.zip
CMake-9ee24ede7363f8349c876e2f1dbbc541f60e3452.tar.gz
CMake-9ee24ede7363f8349c876e2f1dbbc541f60e3452.tar.bz2
Merge topic 'msvc-jmc'
2a9ff9703e MSVC: Add support for /JMC (Just My Code) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3121
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(