diff options
author | Brad King <brad.king@kitware.com> | 2015-10-16 09:35:34 -0400 |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-10-16 09:35:34 -0400 |
commit | f13521317a43af4ebb2996c9916d1d1da695c5fc (patch) | |
tree | 25b68105cef1bbb59f0c9980fb86d72807a97c0a /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | a4f0b01939ca7c69c1e31f017c6e87b642388252 (diff) | |
parent | 55474e6182b49acc4183fffdebccc7ae2a7335fa (diff) | |
download | cmake-f13521317a43af4ebb2996c9916d1d1da695c5fc.tar.gz |
Merge topic 'clean-up-cmTarget'
55474e61 cmState: Move GetTargetTypeName from cmTarget.
38df5c36 Remove now-obsolete casts.
4ee2b267 cmGeneratorTarget: Use enum for GetType.
eac15298 cmState: Move TargetType enum from cmTarget.
482b3811 cmTarget: Move link type enum out.
2ee1cb85 cmTarget: Move ImportInfoMap out of internal class.
a48bcabd cmTarget: Move backtrace member out of internal class.
6694d993 cmTarget: Remove unneeded constructors.
983c00f8 Generators: Use GetType from the cmGeneratorTarget.
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 106 |
1 files changed, 54 insertions, 52 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 7c65146394..79684124c6 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -269,7 +269,7 @@ void cmVisualStudio10TargetGenerator::WriteString(const char* line, void cmVisualStudio10TargetGenerator::Generate() { // do not generate external ms projects - if(this->Target->GetType() == cmTarget::INTERFACE_LIBRARY + if(this->GeneratorTarget->GetType() == cmState::INTERFACE_LIBRARY || this->Target->GetProperty("EXTERNAL_MSPROJECT")) { return; @@ -278,7 +278,7 @@ void cmVisualStudio10TargetGenerator::Generate() this->Target->SetProperty("GENERATOR_FILE_NAME",this->Name.c_str()); this->Target->SetProperty("GENERATOR_FILE_NAME_EXT", ".vcxproj"); - if(this->Target->GetType() <= cmTarget::OBJECT_LIBRARY) + if(this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY) { if(!this->ComputeClOptions()) { @@ -360,7 +360,8 @@ void cmVisualStudio10TargetGenerator::Generate() this->WriteString("<ProjectGUID>", 2); (*this->BuildFileStream) << "{" << this->GUID << "}</ProjectGUID>\n"; - if(this->MSTools && this->Target->GetType() <= cmTarget::GLOBAL_TARGET) + if(this->MSTools + && this->GeneratorTarget->GetType() <= cmState::GLOBAL_TARGET) { this->WriteApplicationTypeSettings(); this->VerifyNecessaryFiles(); @@ -666,17 +667,17 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues() i->c_str(), 1, " Label=\"Configuration\"", "\n"); std::string configType = "<ConfigurationType>"; - switch(this->Target->GetType()) + switch(this->GeneratorTarget->GetType()) { - case cmTarget::SHARED_LIBRARY: - case cmTarget::MODULE_LIBRARY: + case cmState::SHARED_LIBRARY: + case cmState::MODULE_LIBRARY: configType += "DynamicLibrary"; break; - case cmTarget::OBJECT_LIBRARY: - case cmTarget::STATIC_LIBRARY: + case cmState::OBJECT_LIBRARY: + case cmState::STATIC_LIBRARY: configType += "StaticLibrary"; break; - case cmTarget::EXECUTABLE: + case cmState::EXECUTABLE: if(this->NsightTegra && !this->Target->GetPropertyAsBool("ANDROID_GUI")) { @@ -688,8 +689,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues() configType += "Application"; } break; - case cmTarget::UTILITY: - case cmTarget::GLOBAL_TARGET: + case cmState::UTILITY: + case cmState::GLOBAL_TARGET: if(this->NsightTegra) { // Tegra-Android platform does not understand "Utility". @@ -700,8 +701,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues() configType += "Utility"; } break; - case cmTarget::UNKNOWN_LIBRARY: - case cmTarget::INTERFACE_LIBRARY: + case cmState::UNKNOWN_LIBRARY: + case cmState::INTERFACE_LIBRARY: break; } configType += "</ConfigurationType>\n"; @@ -743,7 +744,7 @@ void cmVisualStudio10TargetGenerator mfcLine += useOfMfcValue + "</UseOfMfc>\n"; this->WriteString(mfcLine.c_str(), 2); - if((this->Target->GetType() <= cmTarget::OBJECT_LIBRARY && + if((this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY && this->ClOptions[config]->UsingUnicode()) || this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") || this->GlobalGenerator->TargetsWindowsPhone() || @@ -752,7 +753,7 @@ void cmVisualStudio10TargetGenerator { this->WriteString("<CharacterSet>Unicode</CharacterSet>\n", 2); } - else if (this->Target->GetType() <= cmTarget::MODULE_LIBRARY && + else if (this->GeneratorTarget->GetType() <= cmState::MODULE_LIBRARY && this->ClOptions[config]->UsingSBCS()) { this->WriteString("<CharacterSet>NotSet</CharacterSet>\n", 2); @@ -1480,7 +1481,7 @@ void cmVisualStudio10TargetGenerator::WriteSources( void cmVisualStudio10TargetGenerator::WriteAllSources() { - if(this->Target->GetType() > cmTarget::UTILITY) + if(this->GeneratorTarget->GetType() > cmState::UTILITY) { return; } @@ -1742,8 +1743,8 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() { - cmTarget::TargetType ttype = this->Target->GetType(); - if(ttype > cmTarget::GLOBAL_TARGET) + cmState::TargetType ttype = this->GeneratorTarget->GetType(); + if(ttype > cmState::GLOBAL_TARGET) { return; } @@ -1755,7 +1756,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() config = this->Configurations.begin(); config != this->Configurations.end(); ++config) { - if(ttype >= cmTarget::UTILITY) + if(ttype >= cmState::UTILITY) { this->WritePlatformConfigTag("IntDir", config->c_str(), 3); *this->BuildFileStream @@ -1771,7 +1772,7 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() intermediateDir += "/"; std::string outDir; std::string targetNameFull; - if(ttype == cmTarget::OBJECT_LIBRARY) + if(ttype == cmState::OBJECT_LIBRARY) { outDir = intermediateDir; targetNameFull = this->Target->GetName(); @@ -1827,8 +1828,8 @@ OutputLinkIncremental(std::string const& configName) } // static libraries and things greater than modules do not need // to set this option - if(this->Target->GetType() == cmTarget::STATIC_LIBRARY - || this->Target->GetType() > cmTarget::MODULE_LIBRARY) + if(this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY + || this->GeneratorTarget->GetType() > cmState::MODULE_LIBRARY) { return; } @@ -1966,8 +1967,8 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions( { clOptions.AddFlag("CompileAsWinRT", "true"); // For WinRT components, add the _WINRT_DLL define to produce a lib - if (this->Target->GetType() == cmTarget::SHARED_LIBRARY || - this->Target->GetType() == cmTarget::MODULE_LIBRARY ) + if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY || + this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY ) { clOptions.AddDefine("_WINRT_DLL"); } @@ -2175,8 +2176,8 @@ WriteMasmOptions(std::string const& configName, void cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config) { - if(this->Target->GetType() != cmTarget::STATIC_LIBRARY && - this->Target->GetType() != cmTarget::OBJECT_LIBRARY) + if(this->GeneratorTarget->GetType() != cmState::STATIC_LIBRARY && + this->GeneratorTarget->GetType() != cmState::OBJECT_LIBRARY) { return; } @@ -2212,9 +2213,9 @@ cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config) void cmVisualStudio10TargetGenerator::WriteManifestOptions( std::string const& config) { - if (this->Target->GetType() != cmTarget::EXECUTABLE && - this->Target->GetType() != cmTarget::SHARED_LIBRARY && - this->Target->GetType() != cmTarget::MODULE_LIBRARY) + if (this->GeneratorTarget->GetType() != cmState::EXECUTABLE && + this->GeneratorTarget->GetType() != cmState::SHARED_LIBRARY && + this->GeneratorTarget->GetType() != cmState::MODULE_LIBRARY) { return; } @@ -2380,9 +2381,9 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions( //---------------------------------------------------------------------------- bool cmVisualStudio10TargetGenerator::ComputeLinkOptions() { - if(this->Target->GetType() == cmTarget::EXECUTABLE || - this->Target->GetType() == cmTarget::SHARED_LIBRARY || - this->Target->GetType() == cmTarget::MODULE_LIBRARY) + if(this->GeneratorTarget->GetType() == cmState::EXECUTABLE || + this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY || + this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY) { for(std::vector<std::string>::const_iterator i = this->Configurations.begin(); @@ -2419,11 +2420,11 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config) std::string CONFIG = cmSystemTools::UpperCase(config); const char* linkType = "SHARED"; - if(this->Target->GetType() == cmTarget::MODULE_LIBRARY) + if(this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY) { linkType = "MODULE"; } - if(this->Target->GetType() == cmTarget::EXECUTABLE) + if(this->GeneratorTarget->GetType() == cmState::EXECUTABLE) { linkType = "EXE"; } @@ -2506,7 +2507,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config) std::string targetNameFull; std::string targetNameImport; std::string targetNamePDB; - if(this->Target->GetType() == cmTarget::EXECUTABLE) + if(this->GeneratorTarget->GetType() == cmState::EXECUTABLE) { this->GeneratorTarget->GetExecutableNames(targetName, targetNameFull, targetNameImport, targetNamePDB, @@ -2529,7 +2530,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config) if (this->GlobalGenerator->TargetsWindowsCE()) { linkOptions.AddFlag("SubSystem", "WindowsCE"); - if (this->Target->GetType() == cmTarget::EXECUTABLE) + if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE) { if (this->ClOptions[config]->UsingUnicode()) { @@ -2551,7 +2552,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config) if (this->GlobalGenerator->TargetsWindowsCE()) { linkOptions.AddFlag("SubSystem", "WindowsCE"); - if (this->Target->GetType() == cmTarget::EXECUTABLE) + if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE) { if (this->ClOptions[config]->UsingUnicode()) { @@ -2597,7 +2598,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config) // A Windows Runtime component uses internal .NET metadata, // so does not have an import library. if(this->Target->GetPropertyAsBool("VS_WINRT_COMPONENT") && - this->Target->GetType() != cmTarget::EXECUTABLE) + this->GeneratorTarget->GetType() != cmState::EXECUTABLE) { linkOptions.AddFlag("GenerateWindowsMetadata", "true"); } @@ -2635,7 +2636,7 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config) "%(IgnoreSpecificDefaultLibraries)"); } - if (this->Target->GetType() == cmTarget::SHARED_LIBRARY && + if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY && this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) { if (this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) @@ -2652,8 +2653,8 @@ cmVisualStudio10TargetGenerator::ComputeLinkOptions(std::string const& config) void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const& config) { - if(this->Target->GetType() == cmTarget::STATIC_LIBRARY - || this->Target->GetType() > cmTarget::MODULE_LIBRARY) + if(this->GeneratorTarget->GetType() == cmState::STATIC_LIBRARY + || this->GeneratorTarget->GetType() > cmState::MODULE_LIBRARY) { return; } @@ -2691,7 +2692,7 @@ void cmVisualStudio10TargetGenerator::AddLibraries( libVec.push_back(path); } else if (!l->Target - || l->Target->GetType() != cmTarget::INTERFACE_LIBRARY) + || l->Target->GetType() != cmState::INTERFACE_LIBRARY) { libVec.push_back(l->Value); } @@ -2763,7 +2764,7 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups() this->WritePlatformConfigTag("ItemDefinitionGroup", i->c_str(), 1); *this->BuildFileStream << "\n"; // output cl compile flags <ClCompile></ClCompile> - if(this->Target->GetType() <= cmTarget::OBJECT_LIBRARY) + if(this->GeneratorTarget->GetType() <= cmState::OBJECT_LIBRARY) { this->WriteClOptions(*i, includes); // output rc compile flags <ResourceCompile></ResourceCompile> @@ -2781,7 +2782,7 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups() // output manifest flags <Manifest></Manifest> this->WriteManifestOptions(*i); if(this->NsightTegra && - this->Target->GetType() == cmTarget::EXECUTABLE && + this->GeneratorTarget->GetType() == cmState::EXECUTABLE && this->Target->GetPropertyAsBool("ANDROID_GUI")) { this->WriteAntBuildOptions(*i); @@ -2794,7 +2795,7 @@ void cmVisualStudio10TargetGenerator::WriteEvents(std::string const& configName) { bool addedPrelink = false; - if (this->Target->GetType() == cmTarget::SHARED_LIBRARY && + if (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY && this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS")) { if (this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) @@ -2866,7 +2867,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences() i != depends.end(); ++i) { cmTarget const* dt = (*i)->Target; - if(dt->GetType() == cmTarget::INTERFACE_LIBRARY) + if(dt->GetType() == cmState::INTERFACE_LIBRARY) { continue; } @@ -3002,7 +3003,7 @@ void cmVisualStudio10TargetGenerator::WriteWinRTPackageCertificateKeyFile() { if((this->GlobalGenerator->TargetsWindowsStore() || this->GlobalGenerator->TargetsWindowsPhone()) - && (cmTarget::EXECUTABLE == this->Target->GetType())) + && (cmState::EXECUTABLE == this->GeneratorTarget->GetType())) { std::string pfxFile; std::vector<cmSourceFile const*> certificates; @@ -3131,7 +3132,7 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings() this->WriteString("<MinimumVisualStudioVersion>14.0" "</MinimumVisualStudioVersion>\n", 2); - if(this->Target->GetType() < cmTarget::UTILITY) + if(this->GeneratorTarget->GetType() < cmState::UTILITY) { isAppContainer = true; } @@ -3145,7 +3146,7 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings() this->WriteString("<MinimumVisualStudioVersion>12.0" "</MinimumVisualStudioVersion>\n", 2); - if (this->Target->GetType() < cmTarget::UTILITY) + if (this->GeneratorTarget->GetType() < cmState::UTILITY) { isAppContainer = true; } @@ -3159,12 +3160,13 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings() this->WriteString("<MinimumVisualStudioVersion>11.0" "</MinimumVisualStudioVersion>\n", 2); - if (isWindowsStore && this->Target->GetType() < cmTarget::UTILITY) + if (isWindowsStore + && this->GeneratorTarget->GetType() < cmState::UTILITY) { isAppContainer = true; } else if (isWindowsPhone && - this->Target->GetType() == cmTarget::EXECUTABLE) + this->GeneratorTarget->GetType() == cmState::EXECUTABLE) { this->WriteString("<XapOutputs>true</XapOutputs>\n", 2); this->WriteString("<XapFilename>", 2); @@ -3221,7 +3223,7 @@ void cmVisualStudio10TargetGenerator::VerifyNecessaryFiles() { // For Windows and Windows Phone executables, we will assume that if a // manifest is not present that we need to add all the necessary files - if (this->Target->GetType() == cmTarget::EXECUTABLE) + if (this->GeneratorTarget->GetType() == cmState::EXECUTABLE) { std::vector<cmSourceFile const*> manifestSources; this->GeneratorTarget->GetAppManifest(manifestSources, ""); |