basic manifest tool support in vc(x)proj generator

The removal of embed_manifest_dll or embed_manifest_exe from CONFIG
now disables the embedding of manifests in VS project files.

Task-number: QTBUG-5301

Change-Id: I031318883edca6f9b63a7981ef6c44e3f123f6fd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Joerg Bornemann 2013-06-18 08:58:31 +02:00 committed by The Qt Project
parent 1b972b210a
commit 28a7af7b2a
5 changed files with 58 additions and 0 deletions

View File

@ -53,6 +53,7 @@ QT_BEGIN_NAMESPACE
const char _CLCompile[] = "ClCompile";
const char _ItemGroup[] = "ItemGroup";
const char _Link[] = "Link";
const char _ManifestTool[] = "ManifestTool";
const char _Midl[] = "Midl";
const char _ResourceCompile[] = "ResourceCompile";
@ -104,6 +105,7 @@ const char _DisableSpecificWarnings[] = "DisableSpecificWarnings";
const char _DisplayLibrary[] = "DisplayLibrary";
const char _DLLDataFileName[] = "DLLDataFileName";
const char _EmbedManagedResourceFile[] = "EmbedManagedResourceFile";
const char _EmbedManifest[] = "EmbedManifest";
const char _EnableCOMDATFolding[] = "EnableCOMDATFolding";
const char _EnableUAC[] = "EnableUAC";
const char _EnableErrorChecks[] = "EnableErrorChecks";
@ -1657,6 +1659,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCConfiguration &tool)
<< attrTagS(_UseOfATL, toString(tool.UseOfATL))
<< attrTagS(_UseOfMfc, toString(tool.UseOfMfc))
<< attrTagT(_WholeProgramOptimization, tool.WholeProgramOptimization)
<< attrTagT(_EmbedManifest, tool.manifestTool.EmbedManifest)
<< closetag();
}

View File

@ -97,6 +97,7 @@ const char _Description[] = "Description";
const char _Detect64BitPortabilityProblems[] = "Detect64BitPortabilityProblems";
const char _DisableLanguageExtensions[] = "DisableLanguageExtensions";
const char _DisableSpecificWarnings[] = "DisableSpecificWarnings";
const char _EmbedManifest[] = "EmbedManifest";
const char _EnableCOMDATFolding[] = "EnableCOMDATFolding";
const char _EnableErrorChecks[] = "EnableErrorChecks";
const char _EnableEnhancedInstructionSet[] = "EnableEnhancedInstructionSet";
@ -224,6 +225,7 @@ const char _ValidateParameters[] = "ValidateParameters";
const char _VCCLCompilerTool[] = "VCCLCompilerTool";
const char _VCLibrarianTool[] = "VCLibrarianTool";
const char _VCLinkerTool[] = "VCLinkerTool";
const char _VCManifestTool[] = "VCManifestTool";
const char _VCCustomBuildTool[] = "VCCustomBuildTool";
const char _VCResourceCompilerTool[] = "VCResourceCompilerTool";
const char _VCMIDLTool[] = "VCMIDLTool";
@ -1718,6 +1720,23 @@ bool VCLinkerTool::parseOption(const char* option)
return found;
}
// VCManifestTool ---------------------------------------------------
VCManifestTool::VCManifestTool()
: EmbedManifest(unset)
{
}
VCManifestTool::~VCManifestTool()
{
}
bool VCManifestTool::parseOption(const char *option)
{
Q_UNUSED(option);
// ### implement if we introduce QMAKE_MT_FLAGS
return false;
}
// VCMIDLTool -------------------------------------------------------
VCMIDLTool::VCMIDLTool()
: DefaultCharType(midlCharUnsigned),
@ -2633,6 +2652,14 @@ void VCProjectWriter::write(XmlOutput &xml, const VCLinkerTool &tool)
<< closetag(_Tool);
}
void VCProjectWriter::write(XmlOutput &xml, const VCManifestTool &tool)
{
xml << tag(_Tool)
<< attrS(_Name, _VCManifestTool)
<< attrT(_EmbedManifest, tool.EmbedManifest)
<< closetag(_Tool);
}
void VCProjectWriter::write(XmlOutput &xml, const VCMIDLTool &tool)
{
xml << tag(_Tool)
@ -2764,6 +2791,7 @@ void VCProjectWriter::write(XmlOutput &xml, const VCConfiguration &tool)
write(xml, tool.librarian);
else
write(xml, tool.linker);
write(xml, tool.manifestTool);
write(xml, tool.idl);
write(xml, tool.postBuild);
write(xml, tool.preBuild);

View File

@ -675,6 +675,16 @@ public:
VCConfiguration* config;
};
class VCManifestTool : public VCToolBase
{
public:
VCManifestTool();
~VCManifestTool();
bool parseOption(const char* option);
triState EmbedManifest;
};
class VCMIDLTool : public VCToolBase
{
public:
@ -874,6 +884,7 @@ public:
VCCLCompilerTool compiler;
VCLinkerTool linker;
VCLibrarianTool librarian;
VCManifestTool manifestTool;
VCCustomBuildTool custom;
VCMIDLTool idl;
VCPostBuildEventTool postBuild;
@ -1127,6 +1138,7 @@ public:
virtual void write(XmlOutput &, const VCCLCompilerTool &);
virtual void write(XmlOutput &, const VCLinkerTool &);
virtual void write(XmlOutput &, const VCManifestTool &);
virtual void write(XmlOutput &, const VCMIDLTool &);
virtual void write(XmlOutput &, const VCCustomBuildTool &);
virtual void write(XmlOutput &, const VCLibrarianTool &);

View File

@ -925,6 +925,7 @@ void VcprojGenerator::initConfiguration()
conf.linker.GenerateDebugInformation = isDebug ? _True : _False;
initLinkerTool();
}
initManifestTool();
initResourceTool();
initIDLTool();
@ -1045,6 +1046,19 @@ void VcprojGenerator::initLibrarianTool()
conf.librarian.AdditionalOptions += project->values("QMAKE_LIBFLAGS").toQStringList();
}
void VcprojGenerator::initManifestTool()
{
VCManifestTool &tool = vcProject.Configuration.manifestTool;
const ProString tmplt = project->first("TEMPLATE");
if ((tmplt == "vclib"
&& !project->isActiveConfig("embed_manifest_dll")
&& !project->isActiveConfig("static"))
|| (tmplt == "vcapp"
&& !project->isActiveConfig("embed_manifest_exe"))) {
tool.EmbedManifest = _False;
}
}
void VcprojGenerator::initLinkerTool()
{
VCConfiguration &conf = vcProject.Configuration;

View File

@ -102,6 +102,7 @@ protected:
void initCompilerTool();
void initLinkerTool();
void initLibrarianTool();
void initManifestTool();
void initResourceTool();
void initIDLTool();
void initCustomBuildTool();