diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2010-02-26 10:49:45 (GMT) |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2010-02-26 12:04:31 (GMT) |
commit | 7ca00ed67cb18fb858e1e89cec21b3db696fa923 (patch) | |
tree | 373cc0f4530ef6e46fca2eea63cb18ef9bd10f05 /mkspecs | |
parent | 16affb79e6187038b3b6ee3ac91345a83bb73410 (diff) | |
download | Qt-7ca00ed67cb18fb858e1e89cec21b3db696fa923.zip Qt-7ca00ed67cb18fb858e1e89cec21b3db696fa923.tar.gz Qt-7ca00ed67cb18fb858e1e89cec21b3db696fa923.tar.bz2 |
Added addMMPRules for adding conditional MMP_RULES
Usage:
# Set conditional libraries
LIB.MARM = "LIBRARY myarm.lib"
LIB.WINSCW = "LIBRARY mywinscw.lib"
LIB.default = "LIBRARY mydefault.lib"
# Set conditional Epoc Heap Size
EHZ.WINSCW = "EPOCHEAPSIZE 0x2000 0x2000000"
EHZ.default = "EPOCHEAPSIZE 0x40000 0x400000"
# Add the conditional MMP rules
MYCONDITIONS = MARM WINSCW
MYVARIABLES = LIB EHZ
addMMPRules(MYCONDITIONS, MYVARIABLES)
This will generate the following in the mmp file:
#if defined(MARM)
LIBRARY myarm.lib
EPOCHEAPSIZE 0x40000 0x400000
#elif defined(WINSCW)
LIBRARY mywinscw.lib
EPOCHEAPSIZE 0x2000 0x2000000
#else
LIBRARY mydefault.lib
EPOCHEAPSIZE 0x40000 0x400000
#endif
Task-number: QT-2909
Reviewed-by: axis
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/common/symbian/symbian.conf | 1 | ||||
-rw-r--r-- | mkspecs/features/symbian/add_mmp_rules.prf | 33 |
2 files changed, 34 insertions, 0 deletions
diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index f3026ad..a90ef91 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -107,6 +107,7 @@ QMAKE_STRIPFLAGS_LIB += --strip-unneeded load(qt_config) load(platform_paths) +load(add_mmp_rules) symbian-abld { # Versions of abld prior to Symbian^3 have a bug where you cannot remove something from the command line without replacing it 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) +} |