mirror of
https://github.com/QuasarApp/qca.git
synced 2025-04-28 20:44:31 +00:00
53 lines
1.2 KiB
Plaintext
53 lines
1.2 KiB
Plaintext
|
/*
|
||
|
-----BEGIN QCMOD-----
|
||
|
name: buildmode
|
||
|
section: project
|
||
|
arg: release,Build with debugging turned off
|
||
|
arg: debug,Build with debugging turned on
|
||
|
arg: debug-and-release,Build two versions, with and without debugging turned on (default)
|
||
|
-----END QCMOD-----
|
||
|
*/
|
||
|
|
||
|
#define BUILDMODE
|
||
|
bool buildmode_release = false;
|
||
|
bool buildmode_debug = false;
|
||
|
|
||
|
class qc_buildmode : public ConfObj
|
||
|
{
|
||
|
public:
|
||
|
qc_buildmode(Conf *c) : ConfObj(c) {}
|
||
|
QString name() const { return "buildmode"; }
|
||
|
QString shortname() const { return "buildmode"; }
|
||
|
|
||
|
// no output
|
||
|
QString checkString() const { return QString(); }
|
||
|
|
||
|
bool exec()
|
||
|
{
|
||
|
// build mode
|
||
|
bool release = false;
|
||
|
bool debug = false;
|
||
|
QString config_buildmode;
|
||
|
if(conf->getenv("QC_RELEASE") == "Y")
|
||
|
{
|
||
|
release = true;
|
||
|
config_buildmode = "CONFIG += release\n";
|
||
|
}
|
||
|
else if(conf->getenv("QC_DEBUG") == "Y")
|
||
|
{
|
||
|
debug = true;
|
||
|
config_buildmode = "CONFIG += debug\n";
|
||
|
}
|
||
|
else // if(conf->getenv("QC_DEBUG_AND_RELEASE") == "Y")
|
||
|
{
|
||
|
release = true;
|
||
|
debug = true;
|
||
|
config_buildmode = "CONFIG += debug_and_release build_all\n";
|
||
|
}
|
||
|
buildmode_release = release;
|
||
|
buildmode_debug = debug;
|
||
|
conf->addExtra(config_buildmode);
|
||
|
return true;
|
||
|
}
|
||
|
};
|