Is it possible to define a GYP variable whose value depends on the choice of build configuration?
Asked
Active
Viewed 3,367 times
3 Answers
2
Just use variable $(BUILDTYPE)
or $(ConfigurationName)
.
![](../../users/profiles/3578306.webp)
dr15
- 31
- 3
-
1Better use ` – dr15 Jun 28 '18 at 17:38
-1
I think it's possible if you mean distinctions between 'Debug' and 'Release' by the 'build configuration'. Try to add the following in your *.gyp file:
...
'configurations': {
'Debug': {
'variables': {
'some_variable%' : 'debug_value',
},
'Release': {
'variables': {
'some_variable%' : 'release_value',
},
},
}
...
Links with some more examples: gyp - how to specify link library flavor; http://n8.io/converting-a-c-library-to-gyp/
-
The article can be found at GitHub: https://github.com/TooTallNate/n8.io/blob/master/articles/converting-a-c-library-to-gyp.markdown – dmitris May 06 '13 at 20:48
-
Tried that and it doesn't work. Attempting to use the variable in 'libraries', and just get `Undefined variable some_variable in binding.gyp while trying to load binding.gyp`. – OrangeDog Jul 12 '13 at 10:23