I'm trying to compile Chromium with custom flags passed to the compiler (by modifying CFLAGS
/CXXFLAGS
). According to the documentation, I can do this via making a .gyp
file in the appropriate location containing something like:
{
'targets': [
{
'target_name': 'existing_target',
'conditions': [
['OS=="win"', {
'cflags': [
'/WX',
],
}, { # OS != "win"
'cflags': [
'-Werror',
],
}],
],
},
],
},
The trouble I have is that the value I want to pass in CFLAGS
depends on environmental variables.
So I basically need to do the equivalent of
export CFLAGS="-flag1 '$HOME/foo/bar' -flag2 '$MY_PATH' $MORE_FLAGS"
except I can't, because it doesn't seem like environmental variables in dictionary values are expanded.
(And I obviously don't want to hard-code the values, since that defeats the point of making them environmental variables that I can easily change later...)
How do I solve this problem?