[chromium-dev] Re: How do you do an if-else statement in GYP?
Hi Daniel: Currently you'd have to have another whole conditional inside: 'conditions': [ ['my_variable==Blort', { # path A }, { 'conditions: ['my_variable==Blat', { # path B }, { # path C (default) }], }], -BradN On Wed, Jun 24, 2009 at 2:49 PM, Daniel Cowx daniel.c...@gmail.com wrote: I'd like to be able to test 'my_variable' for 'Blort' and 'Blat', but if neither of these are true, then I'd like to execute a default. The problem is that with the syntax below, if 'my_variable' is 'Blort', then both path A and C will be executed; which is wrong since each of these paths should be mutually exclusive. 'conditions': [ ['my_variable==Blort', { # path A }], ['my_variable==Blat', { # path B }, { # path C (default) }], To fix, I've tried re-arranging like so: 'conditions': [ ['my_variable==Blort', { # path A }, { ['my_variable==Blat', { # path B }, { # path C (default) }], }], But this gives errors when you execute the gyp file (complains about a comma). How do I accomplish this? --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---
[chromium-dev] Re: How do you do an if-else statement in GYP?
Thanks for the prompt reply Brad. Cheers! On Jun 24, 2:52 pm, Bradley Nelson bradnel...@google.com wrote: Hi Daniel: Currently you'd have to have another whole conditional inside: 'conditions': [ ['my_variable==Blort', { # path A }, { 'conditions: ['my_variable==Blat', { # path B }, { # path C (default) }], }], -BradN On Wed, Jun 24, 2009 at 2:49 PM, Daniel Cowx daniel.c...@gmail.com wrote: I'd like to be able to test 'my_variable' for 'Blort' and 'Blat', but if neither of these are true, then I'd like to execute a default. The problem is that with the syntax below, if 'my_variable' is 'Blort', then both path A and C will be executed; which is wrong since each of these paths should be mutually exclusive. 'conditions': [ ['my_variable==Blort', { # path A }], ['my_variable==Blat', { # path B }, { # path C (default) }], To fix, I've tried re-arranging like so: 'conditions': [ ['my_variable==Blort', { # path A }, { ['my_variable==Blat', { # path B }, { # path C (default) }], }], But this gives errors when you execute the gyp file (complains about a comma). How do I accomplish this? --~--~-~--~~~---~--~~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~--~~~~--~~--~--~---