Skip to content

Commit ca9994a

Browse files
committed
PERF: Build the ITK wheels with Ninja on Windows, as the module wheels are
pixi's conda-forge vs2022 activation exports CMAKE_GENERATOR="Visual Studio 17 2022". scikit-build-core honours it, so the seven ITK wheel builds in step 03 ran under MSBuild while ITK itself was configured with -G Ninja. The remote-module wheel build already passes -GNinja explicitly for this reason; do the same for the ITK wheels. Measured on a 16-thread Windows box: step 03 went from 190-216 s under the Visual Studio generator to 159-168 s under Ninja. An explicit -G also makes CMake ignore the ambient CMAKE_GENERATOR_PLATFORM/TOOLSET that the same activation exports and that Ninja would otherwise reject.
1 parent caa90da commit ca9994a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎scripts/build_python_instance_base.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,14 @@ def build_itk_python_wheels(self):
821821
f"--config-setting=cmake.source-dir={self.package_env_config['IPP_SOURCE_DIR'] / 'BuildWheelsSupport'}",
822822
f"--config-setting=build-dir={wheel_configbuild_dir_root/'build'}",
823823
]
824+
if self.target.os_name == "windows":
825+
# Same reason as the remote-module build below: pixi's
826+
# vs2022 activation exports CMAKE_GENERATOR="Visual Studio
827+
# 17 2022", scikit-build-core honours it, and the ITK wheels
828+
# were being built with MSBuild while ITK itself used Ninja.
829+
# An explicit -G also makes CMake ignore the ambient
830+
# CMAKE_GENERATOR_PLATFORM/TOOLSET that Ninja would reject.
831+
cmd.append("--config-setting=cmake.args=-GNinja")
824832
# Build scikit-build defines via builder
825833
scikitbuild_cmdline_args = CMakeArgumentBuilder()
826834
scikitbuild_cmdline_args.update(self.cmake_compiler_configurations.items())

0 commit comments

Comments
 (0)