Is it possible to define a GYP variable whose value depends on the choice of build configuration?
GYP variable based on build configuration
Just use variable $(BUILDTYPE)
or $(ConfigurationName)
.
Looks like it's impossible according to this wiki page:
- Perform “early” or “pre” variable expansion and conditional evaluation.
- ...
- Merge target settings into configurations as appropriate.
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: github.com/TooTallNate/n8.io/blob/master/articles/… –
Fourthclass
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
. –
Amaryl © 2022 - 2024 — McMap. All rights reserved.
<(CONFIGURATION_NAME)
– Isobaric