Open graph opened 5 years ago
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. :)
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.