-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't support target-specific export environment variable #134
Comments
Interesting, I hadn't seen that before. I'd be rather hesitant about using this however, since target-specific variables can infect their dependencies. In most cases, this isn't a problem if you only use what you define, but it can be a source of bugs too. With exported variables, we'd need to change the command line for all of the dependencies, and we can't reproduce the exact same behavior as make (at least in Android, where we don't regenerate the ninja file when changing which targets to build): export foo0=bar0
a: foo1=bar1
a: export foo2=bar2
a: b
echo A: ${foo0} ${foo1} ${foo2}
sh -c 'echo A: $${foo0} $${foo1} $${foo2}'
b:
echo B: ${foo0} ${foo1} ${foo2}
sh -c 'echo B: $${foo0} $${foo1} $${foo2}'
I'll likely be restricting the use of I'm assuming you've got a build rule that contains multiple lines that you'd like to apply the environment variable to all lines? If it's just a line or two, adding it at the beginning of the line isn't too bad, and is what I've been suggesting here. |
Thanks for the quick reply, yes I need to change the PATH for three lines in a rule, and I was just trying to reduce the duplication and was surprised that it didn't work. |
https://www.gnu.org/software/make/manual/html_node/Target_002dspecific.html
The text was updated successfully, but these errors were encountered: