From 23782171ad900dc6eac6a4b8fa4e44f96ffb94bf Mon Sep 17 00:00:00 2001 From: Gilles Khouzam Date: Mon, 11 Aug 2014 14:08:49 -0400 Subject: [PATCH] VS: Handle AppxManifest sources explicitly in generator Teach cmGeneratorTarget to extract .appxmanifest sources separately. Teach cmVisualStudio10TargetGenerator to write them with the AppxManifest tool in .vcxproj files. This will allow us to detect whether the project provides an application manfiest explicitly. --- Source/cmGeneratorTarget.cxx | 14 ++++++++++++++ Source/cmGeneratorTarget.h | 2 ++ Source/cmVisualStudio10TargetGenerator.cxx | 10 +++++----- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index f9b68d47bb..2df259be07 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -53,6 +53,7 @@ struct ExternalObjectsTag {}; struct IDLSourcesTag {}; struct ResxTag {}; struct ModuleDefinitionFileTag {}; +struct AppManifestTag{}; #if !defined(_MSC_VER) || _MSC_VER >= 1310 template @@ -195,6 +196,10 @@ struct TagVisitor { DoAccept::Result>::Do(this->Data, sf); } + else if (ext == "appxmanifest") + { + DoAccept::Result>::Do(this->Data, sf); + } else if(this->Header.find(sf->GetFullPath().c_str())) { DoAccept::Result>::Do(this->Data, sf); @@ -428,6 +433,15 @@ void cmGeneratorTarget srcs = data.ResxSources; } +//---------------------------------------------------------------------------- +void +cmGeneratorTarget +::GetAppManifest(std::vector& data, + const std::string& config) const +{ + IMPLEMENT_VISIT(AppManifest); +} + //---------------------------------------------------------------------------- bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir, const std::string& config) const diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 29aa4106ff..c2c4801ce9 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -54,6 +54,8 @@ public: const std::string& config) const; void GetExpectedResxHeaders(std::set&, const std::string& config) const; + void GetAppManifest(std::vector&, + const std::string& config) const; void ComputeObjectMapping(); diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 4927d6bc31..3b7f9814c0 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1022,11 +1022,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf) std::string tool = "None"; std::string shaderType; std::string const& ext = sf->GetExtension(); - if(ext == "appxmanifest") - { - tool = "AppxManifest"; - } - else if(ext == "hlsl") + if(ext == "hlsl") { tool = "FXCompile"; // Figure out the type of shader compiler to use. @@ -1221,6 +1217,10 @@ void cmVisualStudio10TargetGenerator::WriteAllSources() } } + std::vector manifestSources; + this->GeneratorTarget->GetAppManifest(manifestSources, ""); + this->WriteSources("AppxManifest", manifestSources); + std::vector externalObjects; this->GeneratorTarget->GetExternalObjects(externalObjects, ""); for(std::vector::iterator