-
Notifications
You must be signed in to change notification settings - Fork 128
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
(Maybe) allow a way to specify the generator via an environment variable #66
Comments
Perhaps a variable could be added here like Either that or putting it in |
Editing title to be a little more clear. The fundamental problem I guess is that the crate using cmake might be deep in the dependency tree from the top-level crate being built. And the build systems available in the environment are determined at that top level. So that's the level that should be able to control which build generator cmake uses. This seems like a textbook example of what environment variables are for. (Edit: sorry, didn't see your reply before posting this, for some reason I didn't get a notification...) Regarding your |
Oh I'm just thinking that if ninja is installed and a build script is whitelisted to work with it then there's no need to use the native build system, we could just always use ninja. Ninja probably doesn't work by default with most projects though, which is why I'd imagine that an opt-in might be necessary |
Ah, I was assuming that if one generator (e.g VisualStudio) works then others (e.g Ninja) would work too. I figured that if that's not the case then it's a |
Add an env var for cmake generator Some discussion in rust-lang/cmake-rs#66, it's not clear to me what the best solution is yet but I'm putting up this patch here anyway. It certainly solves my issue and unblocks me, so please feel free to merge this if it's acceptable. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/libfreetype2/28) <!-- Reviewable:end -->
Right now
cmake-rs
seems to default to VisualStudio as the generator if the rustc target is msvc. However in my particular use case I would like to use Ninja. Ordinarily, the user ofcmake-rs
(in this case thebuild.rs
script inservo-freetype-sys
) would just set.generator("Ninja")
and that would be fine. However that will change it for all consumers ofservo-freetype-sys
instead of just for my environment.What I would like to do is add some sort of env var that I can set that will set the generator to be Ninja. But I'm unsure if the env var should be read from
cmake-rs
or fromservo-freetype-sys
. @alexcrichton Thoughts?On the one hand I'm leaning towards doing it in
servo-freetype-sys
because it's a smaller change there. But on the other hand if I have a crate that depends on multiple sub-crates that all build stuff withcmake
, it kind of makes sense to just put it incmake-rs
since the environment that's doing the build will have the same build tools available (in my case, Ninja) for all the sub-crates, and having to modify each sub-crate seems like a waste.The text was updated successfully, but these errors were encountered: