diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 26 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 1 |
2 files changed, 27 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( diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 9598a3f..d6d463b 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -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); |