Skip to content
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

add support for loading environment variables globally #1610

Open
graph opened this issue Jul 31, 2019 · 1 comment
Open

add support for loading environment variables globally #1610

graph opened this issue Jul 31, 2019 · 1 comment

Comments

@graph
Copy link

graph commented Jul 31, 2019

Problem

For windows build using msvc the proper environment variables need to specified. It is not enough to call the compiler alone. different build directories may have different sets of environment variables used and keeping track of this is prone to programmer errors.

Proposed Solution

add a set_env command in ninja to set environment variables for the ninja process that will propagate to all sub commands.

@eli-schwartz
Copy link

A general workaround for this is for ninja generators to emit a warning message when the compiler is MSVC, cautioning the user to NOT run ninja under any circumstances, and only to run some (probably slow) wrapper script that repeats the song-and-a-dance of finding a suitable vswhere, running it, scraping for output, etc.

This is not convenient, and it still leaves the bad UX of running ninja directly resulting in very inscrutable errors about cl.exe

This seems to be similar to the ninja -t msvc functionality except it would be better to just load it once at startup. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants