Skip to content

fix(cmake): keep CMP0190 cross-compiling default across reconfigure - #6267

Merged
rwgk merged 1 commit into
pybind:masterfrom
henryiii:fix/cmake-cmp0190-reconfigure
Nov 21, 2026
Merged

rwgk merged 1 commit into
pybind:masterfrom
henryiii:fix/cmake-cmp0190-reconfigure

Conversation

@henryiii

Copy link
Copy Markdown
Collaborator

🤖 AI text below 🤖

The cross-compiling default used the marker _PYBIND11_USE_CROSSCOMPILING_DEFAULTED, which is not cached, while option() caches PYBIND11_USE_CROSSCOMPILING as OFF. On the second configure the marker was empty and the default became OFF. The default is now computed before option() and given as the option default, so the cache keeps it. An explicit -DPYBIND11_USE_CROSSCOMPILING=OFF is still respected. tools/pybind11Common.cmake keeps the same default for find_package() consumers, where the option does not exist.

Fixes item 27 of #6159. Split out of #6165.

Suggested changelog entry:

  • Keep the CMP0190 cross-compiling default for PYBIND11_USE_CROSSCOMPILING when CMake is configured a second time.

@rwgk
rwgk merged commit 6b72b68 into pybind:master Nov 21, 2026
96 checks passed
@rwgk
rwgk deleted the fix/cmake-cmp0190-reconfigure branch November 21, 2026 18:15
@github-actions github-actions Bot added the needs changelog Possibly needs a changelog entry label Nov 21, 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.

2 participants