Skip to content

[feat/precompile-pybind11-h] feat: expose the precompiled-mode sources to non-CMake builds - #6137

Merged
henryiii merged 1 commit into
feat/precompile-pybind11-hfrom
feat/precompile-tooling
Oct 3, 2026
Merged

henryiii merged 1 commit into
feat/precompile-pybind11-hfrom
feat/precompile-tooling

Conversation

@henryiii

@henryiii henryiii commented Aug 7, 2026 •

Copy link
Copy Markdown
Collaborator

🤖 AI text below 🤖

Description

Stacked on #6136. Gives non-CMake build systems (such as Meson) a way to use the precompiled mode:

  • pybind11.get_source_dir() and python -m pybind11 --srcdir locate the shipped src/ directory (installed package or repo checkout), mirroring get_include().
  • pybind11.pc gains a srcdir= variable.

Meson users: dependency('pybind11').get_variable('srcdir') + -DPYBIND11_PRECOMPILED — a documentation snippet lands in the docs PR.

Suggested changelog entry:

  • Placeholder.

📚 Documentation preview 📚: https://pybind11--6137.org.readthedocs.build/


📚 Documentation preview 📚: https://pybind11--6137.org.readthedocs.build/

@henryiii
henryiii force-pushed the feat/precompile-tooling branch from d355af3 to 9b2f2fa Compare August 7, 2026 03:25
@henryiii
henryiii force-pushed the feat/precompile-tooling branch from 9b2f2fa to 66f3f6d Compare August 7, 2026 03:27
@henryiii
henryiii force-pushed the feat/precompile-tooling branch from 66f3f6d to ebed7aa Compare August 7, 2026 03:33
@henryiii
henryiii force-pushed the feat/precompile-tooling branch 2 times, most recently from 1cf3e84 to bbcdcf6 Compare August 7, 2026 16:27
@henryiii
henryiii force-pushed the feat/precompile-tooling branch 2 times, most recently from 80852b2 to b62428d Compare August 9, 2026 02:51
@henryiii
henryiii force-pushed the feat/precompile-tooling branch from b62428d to 5165282 Compare August 11, 2026 02:59
@henryiii
henryiii force-pushed the feat/precompile-tooling branch from 5165282 to d0cbf2c Compare August 11, 2026 22:13
@henryiii
henryiii force-pushed the feat/precompile-tooling branch 2 times, most recently from 4f75f5f to 8cbb4a7 Compare August 14, 2026 17:24
@henryiii

Copy link
Copy Markdown
Collaborator Author

I'm quite find to not add this to the classic setuptools tooling too. There are some caveats and users really should be using a modern build system instead.

@henryiii
henryiii force-pushed the feat/precompile-tooling branch from 8cbb4a7 to 8dd6204 Compare August 15, 2026 03:45
@henryiii
henryiii force-pushed the feat/precompile-tooling branch from 8dd6204 to 1d3436a Compare August 17, 2026 04:50
@henryiii
henryiii force-pushed the feat/precompile-tooling branch from 1d3436a to 86e9c15 Compare September 27, 2026 02:19
Adds pybind11.get_source_dir() / python -m pybind11 --srcdir and a
srcdir variable in pybind11.pc, so build systems such as Meson can
compile src/pybind11_combined.cpp with PYBIND11_PRECOMPILED defined.

Assisted-by: ClaudeCode:claude-fable-5
@henryiii
henryiii force-pushed the feat/precompile-tooling branch from 86e9c15 to 572efd1 Compare September 28, 2026 16:38
@henryiii
henryiii merged commit f21c591 into master Oct 3, 2026
96 of 165 checks passed
@henryiii
henryiii deleted the feat/precompile-tooling branch October 3, 2026 17:56
@github-actions github-actions Bot added the needs changelog Possibly needs a changelog entry label Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs changelog Possibly needs a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant