C Runtime, Compiler and Build System Generator

Build system generator

Since scikit-build simply provides glue between setuptools and CMake, a CMake generator is used to configure the build system allowing to build of CPython C extensions.

Changed in version 1.0: scikit-build no longer probes for installed Visual Studio versions or runs a language test to discover a working generator. CMake’s own default generator selection applies.

CMake selects its default generator for the current platform, and the CMAKE_GENERATOR environment variable can be used to override it:

CMAKE_GENERATOR="Unix Makefiles" pip install .

Ninja is the recommended generator. It is automatically parallel and is available on all platforms; listing the ninja python package in the build-system.requires table of your pyproject.toml (see Example of setup.py, CMakeLists.txt and pyproject.toml) ensures it is available during the build. On Windows, MSVC 2017 and newer ship with Ninja already, so ninja can be limited to non-Windows systems in build-system.requires.

For more details about CMake generators, see the CMake documentation.

Compiler

The compiler is selected by CMake following its usual rules; the CC and CXX environment variables can be used to point at specific compilers. The compiler toolchain used to build the target CPython interpreter should be available; refer to the table below for the usual distribution mechanisms for each operating system.

Linux

MacOSX

Windows

C runtime

GNU C Library (glibc)

libSystem

Microsoft C run-time library

Compiler

GNU compiler (gcc)

clang

Microsoft C/C++ Compiler (cl.exe)

Provenance

Package manager

OSX SDK within XCode