summaryrefslogtreecommitdiff
path: root/src/lib/api
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2013-05-30 17:27:51 +0200
committerJoerg Bornemann <joerg.bornemann@digia.com>2013-05-31 16:54:56 +0200
commitaa3aae3fcbebd26db449b9e295b89f9fe890d263 (patch)
tree8ad2ef41d1ea16762ebec20575e18d3c5c1eade0 /src/lib/api
parent085c36cd85ce9cffe8c5b348aaac94a1b2c60b16 (diff)
downloadqbs-aa3aae3fcbebd26db449b9e295b89f9fe890d263.tar.gz
Check for valid build variant.
Otherwise error messages might be misleading. Note: The code assumes the current "debug"/"release" dichotomy and will have to be adapted once we allow users to provide their own build variants. Task-number: QBS-285 Change-Id: Ie972cdeaaad5d121f24e595217596e0bbaf34fd1 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/lib/api')
-rw-r--r--src/lib/api/project.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/api/project.cpp b/src/lib/api/project.cpp
index c158fb8a1..c19058e67 100644
--- a/src/lib/api/project.cpp
+++ b/src/lib/api/project.cpp
@@ -266,6 +266,14 @@ static QVariantMap expandBuildConfiguration(const QVariantMap &buildConfig, Sett
{
QVariantMap expandedConfig = buildConfig;
+ const QString buildVariant = expandedConfig.value(QLatin1String("qbs.buildVariant")).toString();
+ if (buildVariant.isEmpty())
+ throw Error(Tr::tr("No build variant set."));
+ if (buildVariant != QLatin1String("debug") && buildVariant != QLatin1String("release")) {
+ throw Error(Tr::tr("Invalid build variant '%1'. Must be 'debug' or 'release'.")
+ .arg(buildVariant));
+ }
+
// Fill in buildCfg in this order (making sure not to overwrite a key already set by a previous stage)
// 1) Things specified on command line (already in buildCfg at this point)
// 2) Everything from the profile key