//initialize the base
QHash<QString, QStringList> basevars;
+ QStringList basecfgs;
if(!project->isEmpty(build + ".CONFIG"))
- basevars["CONFIG"] += project->values(build + ".CONFIG");
- basevars["CONFIG"] += build;
- basevars["CONFIG"] += "build_pass";
+ basecfgs = project->values(build + ".CONFIG");
+ basecfgs += build;
+ basecfgs += "build_pass";
+ basevars["CONFIG"] = basecfgs;
basevars["BUILD_PASS"] = QStringList(build);
QStringList buildname = project->values(build + ".name");
basevars["BUILD_NAME"] = (buildname.isEmpty() ? QStringList(build) : buildname);
//create project
QMakeProject *build_proj = new QMakeProject(project->properties(), basevars);
+ build_proj->setExtraConfigs(basecfgs);
- //all the user configs must be set again afterwards (for .pro tests and for .prf tests)
- const QStringList old_after_user_config = Option::after_user_configs;
- const QStringList old_user_config = Option::user_configs;
- Option::after_user_configs += basevars["CONFIG"];
- Option::user_configs += basevars["CONFIG"];
build_proj->read(project->projectFile());
- Option::after_user_configs = old_after_user_config;
- Option::user_configs = old_user_config;
//done
return createMakefileGenerator(build_proj);
QStringList Option::before_user_vars;
QStringList Option::after_user_vars;
QStringList Option::user_configs;
-QStringList Option::after_user_configs;
QString Option::user_template;
QString Option::user_template_prefix;
QStringList Option::shellPath;
static int warn_level;
enum QMAKE_RECURSIVE { QMAKE_RECURSIVE_DEFAULT, QMAKE_RECURSIVE_YES, QMAKE_RECURSIVE_NO };
static QMAKE_RECURSIVE recursive;
- static QStringList before_user_vars, after_user_vars, user_configs, after_user_configs;
+ static QStringList before_user_vars, after_user_vars, user_configs;
enum HOST_MODE { HOST_UNKNOWN_MODE, HOST_UNIX_MODE, HOST_WIN_MODE, HOST_MACX_MODE };
static HOST_MODE host_mode;
enum TARG_MODE { TARG_UNKNOWN_MODE, TARG_UNIX_MODE, TARG_WIN_MODE, TARG_MACX_MODE,
parse("CONFIG += " + Option::user_configs.join(" "), vars);
}
+ // After user configs, to override them
+ if (!extra_configs.isEmpty()) {
+ parser.file = "(extra configs)";
+ parser.from_file = false;
+ parser.line_no = 1; //really arg count now.. duh
+ parse("CONFIG += " + extra_configs.join(" "), vars);
+ }
+
if(cmd & ReadProFile) { // parse project file
debug_msg(1, "Project file: reading %s", pfile.toLatin1().constData());
if(pfile != "-" && !QFile::exists(pfile) && !pfile.endsWith(Option::pro_ext))
}
}
- //after configs (set in BUILDS)
- if ((cmd & ReadSetup) && !Option::after_user_configs.isEmpty()) {
- parser.file = "(configs)";
+ // Again, to ensure the project does not mess with us.
+ // Specifically, do not allow a project to override debug/release within a
+ // debug_and_release build pass - it's too late for that at this point anyway.
+ if (!extra_configs.isEmpty()) {
+ parser.file = "(extra configs)";
parser.from_file = false;
parser.line_no = 1; //really arg count now.. duh
- parse("CONFIG += " + Option::after_user_configs.join(" "), vars);
+ parse("CONFIG += " + extra_configs.join(" "), vars);
}
if(cmd & ReadFeatures) {
QString pfile, cfile;
QMakeProperty *prop;
void reset();
+ QStringList extra_configs;
QHash<QString, QStringList> vars, base_vars;
bool parse(const QString &text, QHash<QString, QStringList> &place, int line_count=1);
QMakeProject(QMakeProperty *p, const QHash<QString, QStringList> &nvars) { init(p, &nvars); }
~QMakeProject();
+ void setExtraConfigs(const QStringList &_cfgs) { extra_configs = _cfgs; }
+
enum { ReadProFile=0x01, ReadSetup=0x02, ReadFeatures=0x04, ReadAll=0xFF };
inline bool parse(const QString &text) { return parse(text, vars); }
bool read(const QString &project, uchar cmd=ReadAll);