summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx29
1 files changed, 24 insertions, 5 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 326ab15..413166e 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2869,6 +2869,23 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"));
}
+ // Add C-specific flags expressible in a ClCompile meant for C++.
+ if (langForClCompile == "CXX") {
+ std::set<std::string> languages;
+ this->GeneratorTarget->GetLanguages(languages, configName);
+ if (languages.count("C")) {
+ std::string flagsC;
+ this->LocalGenerator->AddCompileOptions(flagsC, this->GeneratorTarget,
+ "C", configName);
+ Options optC(this->LocalGenerator, Options::Compiler,
+ gg->GetClFlagTable());
+ optC.Parse(flagsC);
+ if (const char* stdC = optC.GetFlag("LanguageStandard_C")) {
+ clOptions.AddFlag("LanguageStandard_C", stdC);
+ }
+ }
+ }
+
// Add a definition for the configuration name.
std::string configDefine = cmStrCat("CMAKE_INTDIR=\"", configName, '"');
clOptions.AddDefine(configDefine);
@@ -3775,12 +3792,14 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
std::string pdb = cmStrCat(this->GeneratorTarget->GetPDBDirectory(config),
'/', targetNames.PDB);
- std::string imLib =
- cmStrCat(this->GeneratorTarget->GetDirectory(
- config, cmStateEnums::ImportLibraryArtifact),
- '/', targetNames.ImportLibrary);
+ if (!targetNames.ImportLibrary.empty()) {
+ std::string imLib =
+ cmStrCat(this->GeneratorTarget->GetDirectory(
+ config, cmStateEnums::ImportLibraryArtifact),
+ '/', targetNames.ImportLibrary);
- linkOptions.AddFlag("ImportLibrary", imLib);
+ linkOptions.AddFlag("ImportLibrary", imLib);
+ }
linkOptions.AddFlag("ProgramDataBaseFile", pdb);
// A Windows Runtime component uses internal .NET metadata,