qmake: add QMAKE_EXPORTED_VARIABLES
because QMAKE_EXTRA_VARIABLES sometimes just ain't enough. Change-Id: I739e5b6510e4701ca0a86834e4f9a978d7ef1cf4 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
parent
2f4eea5b9c
commit
fff59911a3
@ -2212,6 +2212,25 @@ MakefileGenerator::writeExtraVariables(QTextStream &t)
|
||||
}
|
||||
}
|
||||
|
||||
// This is a more powerful alternative to the above function.
|
||||
// It's meant to be internal, as one can make quite a mess with it.
|
||||
void
|
||||
MakefileGenerator::writeExportedVariables(QTextStream &t)
|
||||
{
|
||||
const auto &vars = project->values("QMAKE_EXPORTED_VARIABLES");
|
||||
if (vars.isEmpty())
|
||||
return;
|
||||
for (const auto &exp : vars) {
|
||||
const ProString &name = project->first(ProKey(exp + ".name"));
|
||||
const ProString &value = project->first(ProKey(exp + ".value"));
|
||||
if (!value.isEmpty())
|
||||
t << name << " = " << value << endl;
|
||||
else
|
||||
t << name << " =\n";
|
||||
}
|
||||
t << endl;
|
||||
}
|
||||
|
||||
bool
|
||||
MakefileGenerator::writeDummyMakefile(QTextStream &t)
|
||||
{
|
||||
|
@ -79,6 +79,7 @@ protected:
|
||||
void writeHeader(QTextStream &t);
|
||||
void writeSubDirs(QTextStream &t);
|
||||
void writeMakeQmake(QTextStream &t, bool noDummyQmakeAll = false);
|
||||
void writeExportedVariables(QTextStream &t);
|
||||
void writeExtraVariables(QTextStream &t);
|
||||
void writeExtraTargets(QTextStream &t);
|
||||
void writeExtraCompilerTargets(QTextStream &t);
|
||||
|
@ -180,6 +180,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
|
||||
ProStringList &bundledFiles = project->values("QMAKE_BUNDLED_FILES");
|
||||
|
||||
writeExportedVariables(t);
|
||||
|
||||
t << "####### Compiler, tools and options\n\n";
|
||||
t << "CC = " << var("QMAKE_CC") << endl;
|
||||
t << "CXX = " << var("QMAKE_CXX") << endl;
|
||||
|
@ -520,6 +520,8 @@ void Win32MakefileGenerator::writeIncPart(QTextStream &t)
|
||||
|
||||
void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
|
||||
{
|
||||
writeExportedVariables(t);
|
||||
|
||||
t << "####### Compiler, tools and options\n\n";
|
||||
t << "CC = " << var("QMAKE_CC") << endl;
|
||||
t << "CXX = " << var("QMAKE_CXX") << endl;
|
||||
|
Loading…
x
Reference in New Issue
Block a user