Closed SanderVocke closed 7 months ago
Thanks for the report!
I've added a check in 2fba7c5404cc0cf2a68914b780ae52b404aafd32.
You can try it out using the following in your pyproject.toml
:
[build-system]
requires = [
"py-build-cmake@git+https://github.com/tttapa/py-build-cmake@2fba7c5404cc0cf2a68914b780ae52b404aafd32",
]
build-backend = "py_build_cmake.build"
Seems to work like a charm, thanks for the lightning-fast fix!
Noticed this trying to run a Ninja-based build on Windows with py-build-cmake.
py-build-cmake passes the -A x64 flag to cmake on Windows. This will lead to an error if using Ninja (or most other non-MSVC builders).
I found in the code that this happens in get_cmake_generator_platform. It seems indeed to be based on the OS and not on the generator.
According to the CMake docs (https://cmake.org/cmake/help/latest/variable/CMAKE_GENERATOR_PLATFORM.html), only Visual Studio generators and "Green Hills MULTI" generators support the -A flag.
Could another check be added to ensure the -A is only passed when using a VS generator?