ITADN

Question: Viable to automatically set CMAKE_GENERATOR default environment variable based on presence of ninja?

#2487Openmatthewfeickert 创建于 2026-05-09
M
matthewfeickertcommented
As of `rattler-build` `v0.1.0` / PR https://github.com/prefix-dev/rattler-build/pull/93 the default environmental variables for `CMAKE_GENERATOR` has been https://github.com/prefix-dev/rattler-build/blob/dc88d71059389a6d9bbd82cd50c75aff340cc89c/docs/build_script.md?plain=1#L199-L202 In https://github.com/prefix-dev/pixi/issues/6057 / https://github.com/matthewfeickert-debug/pixi-build-with-scikit-build-core I learned that this also means that this means that when using the `pixi-build-python` `pixi-build` backend with `scikit-build-core` that `scikit-build-core`'s defaults of using Ninja get overrriden. One can workaround this by providing `scikit-build-core` explicit arguments through the `[tool.scikit-build]` `pyproject.toml` table to override the environment and restore the default settings. ```toml [tool.scikit-build] ... cmake.args = ["-GNinja"] ``` Would it be possible to have `rattler-build` default to `Ninja` when the `ninja` executable is present in either the build or host prefix, and if not _then_ fall back to `Unix Makefiles`? Or does this open up the door to trying to support too many things "cleverly" automatically, which then becomes unmaintainable?
6 条评论