chore(cmake): carry option-driven defines on pybind11_headers INTERFACE - #6130
Open
henryiii wants to merge 1 commit into
Open
chore(cmake): carry option-driven defines on pybind11_headers INTERFACE#6130henryiii wants to merge 1 commit into
henryiii wants to merge 1 commit into
Conversation
PYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION and PYBIND11_SIMPLE_GIL_MANAGEMENT were directory-scoped add_compile_definitions, which only reached the master-project test build. On the pybind11_headers INTERFACE (like PYBIND11_INTERNALS_VERSION) they also apply in add_subdirectory mode and in the exported/installed targets. Assisted-by: ClaudeCode:claude-fable-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a general fix anyway, can stand on its own.
🤖 AI text below 🤖
Description
PYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATIONandPYBIND11_SIMPLE_GIL_MANAGEMENTwere applied with a directory-scopedadd_compile_definitions, so they only took effect in the master-project (test) build. Move them onto thepybind11_headersINTERFACE, the same pattern asPYBIND11_INTERNALS_VERSION. The options now also work inadd_subdirectorymode and ride the exported/installed targets.This is step 0 of the optional pre-compilation work: must-match configuration macros have to propagate through
pybind11::headersso a future precompiled static library and consumer modules always agree.Suggested changelog entry:
PYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATIONandPYBIND11_SIMPLE_GIL_MANAGEMENTnow apply inadd_subdirectorymode and to installed/exported targets, not only when pybind11 is the top-level project.