Skip to content

Compile PyBind11 on Windows

Requirements

Get PyBind11 source

You can find the source of PyBind11 from GitHub

compile

bash
cmake -S . -B ./build \
 -DPYTHON_EXECUTABLE=<YOUR_PYTHON_EXECUTABLE_DIR>\python.exe \
 -DBoost_INCLUDE_DIR=<BOOST_SOURCE_DIR>/install_prefix2/include \
 -DCMAKE_BUILD_TYPE=Release

cmake --build ./build --config Release --target check

You can find the compiled files in ./mock_install