diff options
author | Brad King <brad.king@kitware.com> | 2016-10-20 12:51:24 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-10-20 12:51:24 (GMT) |
commit | 7aa9961939f99c915485d86e460b9941f949d59c (patch) | |
tree | 93d61b5dc2cb49a6e1172aa499d9df986e35ced1 /Source | |
parent | fc7ecd6b0570d91a31221203e4bbaf7e48006662 (diff) | |
parent | f27492a4db2c56f334b2ca5c746b01b8e9a04995 (diff) | |
download | CMake-7aa9961939f99c915485d86e460b9941f949d59c.zip CMake-7aa9961939f99c915485d86e460b9941f949d59c.tar.gz CMake-7aa9961939f99c915485d86e460b9941f949d59c.tar.bz2 |
Merge topic 'vs-csharp-prep'
f27492a4 VS: Add internal API for detecting "managed" projects
4f78b9ff VS: Add CSharp project uuid and file extension
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalVisualStudio71Generator.cxx | 4 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.cxx | 21 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.h | 3 | ||||
-rw-r--r-- | Source/cmVisualStudioGeneratorOptions.cxx | 5 | ||||
-rw-r--r-- | Source/cmVisualStudioGeneratorOptions.h | 1 |
5 files changed, 34 insertions, 0 deletions
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 6941e15..8af0512 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -159,6 +159,10 @@ void cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout, ext = ".vfproj"; project = "Project(\"{6989167D-11E4-40FE-8C1A-2192A86A7E90}\") = \""; } + if (this->TargetIsCSharpOnly(t)) { + ext = ".csproj"; + project = "Project(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \""; + } const char* targetExt = t->GetProperty("GENERATOR_FILE_NAME_EXT"); if (targetExt) { ext = targetExt; diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 0782182..67c355b 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -736,6 +736,27 @@ bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly( return false; } +bool cmGlobalVisualStudioGenerator::TargetIsCSharpOnly( + cmGeneratorTarget const* gt) +{ + // check to see if this is a C# build + std::set<std::string> languages; + { + // Issue diagnostic if the source files depend on the config. + std::vector<cmSourceFile*> sources; + if (!gt->GetConfigCommonSourceFiles(sources)) { + return false; + } + } + gt->GetLanguages(languages, ""); + if (languages.size() == 1) { + if (*languages.begin() == "CSharp") { + return true; + } + } + return false; +} + bool cmGlobalVisualStudioGenerator::TargetCompare::operator()( cmGeneratorTarget const* l, cmGeneratorTarget const* r) const { diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index a774d96..c8fc984 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -69,6 +69,9 @@ public: // return true if target is fortran only bool TargetIsFortranOnly(const cmGeneratorTarget* gt); + // return true if target is C# only + static bool TargetIsCSharpOnly(cmGeneratorTarget const* gt); + /** Get the top-level registry key for this VS version. */ std::string GetRegistryBase(); diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 9badda6..4be183d 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -137,6 +137,11 @@ bool cmVisualStudioGeneratorOptions::IsWinRt() const return this->FlagMap.find("CompileAsWinRT") != this->FlagMap.end(); } +bool cmVisualStudioGeneratorOptions::IsManaged() const +{ + return this->FlagMap.find("CompileAsManaged") != this->FlagMap.end(); +} + bool cmVisualStudioGeneratorOptions::UsingUnicode() const { // Look for the a _UNICODE definition. diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h index 4eeae3d..0a0b96d 100644 --- a/Source/cmVisualStudioGeneratorOptions.h +++ b/Source/cmVisualStudioGeneratorOptions.h @@ -49,6 +49,7 @@ public: bool IsDebug() const; bool IsWinRt() const; + bool IsManaged() const; // Write options to output. void OutputPreprocessorDefinitions(std::ostream& fout, const char* prefix, const char* suffix, |