diff options
Diffstat (limited to 'mkspecs/features')
-rw-r--r-- | mkspecs/features/symbian/add_mmp_rules.prf | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/mkspecs/features/symbian/add_mmp_rules.prf b/mkspecs/features/symbian/add_mmp_rules.prf new file mode 100644 index 0000000..5384dbe --- /dev/null +++ b/mkspecs/features/symbian/add_mmp_rules.prf @@ -0,0 +1,33 @@ +# Arg1: List of conditions to generate block for +# Arg2: List of variables containing rules to add +defineTest(addMMPRules) { + unset(myConditions) + unset(myVariables) + unset(myIfDef) + + myConditions = $$eval($$1) default + myVariables = $$eval($$2) + myIfDef = if + + for(condition, $$list($$myConditions)) { + contains(condition, default) { + libBlock = "$${LITERAL_HASH}else" + } else { + libBlock = "$${LITERAL_HASH}$${myIfDef} defined($${condition})" + myIfDef = elif + } + + for(var, $$list($$myVariables)) { + varVal = $$eval($${var}.$${condition}) + isEmpty(varVal) { + # No value defined for current condition, so use default + varVal = $$eval($${var}.default) + } + !isEmpty(varVal): libBlock += "$$join(varVal,$$escape_expand(\n))" + } + + MMP_RULES += $$libBlock + } + MMP_RULES += "$${LITERAL_HASH}endif" + export(MMP_RULES) +} |