Open GoogleCodeExporter opened 9 years ago
This is correct, variables aren’t reloaded in between conditions. (Maybe they
could be, if it doesn’t break anything.)
Move the first condition into the outer variables block? You’d have
'variables':{'conditions':[['1',{'type':'none'}]]} instead of
'conditions':[['1','variables':{'type':'none'}]] that way.
If you need to use another variable inside your condition, you may need to use
the variables-inside-variables hack, like
'variables':{'variables':{'true':'1'},'true%':'<(true)'}. See the comment in
chrome’s build/common.gypi about “putting a variables dict inside another
variables dict.”
Putting that all together, it would look like this:
'variables': {
'variables': {
'true': '1',
},
'true%': '<(true)',
'conditions': [
['true==1', {
'type': 'none',
]},
],
},
'conditions': [
['true==1', {
'targets': [
{
'target_name': 'main',
'type': '<(type)',
},
],
}],
],
(or something like that, I haven’t actually tried.)
Original comment by mark@chromium.org
on 27 Aug 2010 at 3:05
Original comment by mark@chromium.org
on 27 Aug 2010 at 3:05
Original issue reported on code.google.com by
maruel@chromium.org
on 27 Aug 2010 at 12:59