Repository navigation
cmake: Align CMake build with pybind11_abseil (CMake 3.22, C++17) - #264
Merged
Merged
Conversation
copybara-service
Bot
force-pushed
the
cl/1024374780
branch
3 times, most recently
from
November 27, 2026 12:35
021eaf4 to
2376288
Compare
Update the CMake files to match `pybind11_abseil`:
* Require CMake 3.22, default to C++17 across platforms, set `CMP0135` to `NEW`.
* Add `pybind11_protobuf_build_tree_module` to output extension modules directly in `${CMAKE_CURRENT_BINARY_DIR}` under multi-config generators and copy runtime DLLs next to `.pyd` modules on Windows.
* Link `protobuf::libprotobuf` publicly on generated `OBJECT` proto targets (propagating `PROTOBUF_USE_DLLS` and `ABSL_CONSUME_DLL` on MSVC), set `protobuf_MSVC_STATIC_RUNTIME` to `OFF`, place Windows build-time executables and DLLs under `${CMAKE_BINARY_DIR}/bin` so `protoc.exe` locates `abseil_dll.dll`, and add explicit inter-proto generation dependencies.
* Honor `PYBIND11_PROTOBUF_BUILD_TESTING` in `CMakeLists.txt` and remove the stale `pybind11_abseil` `install()` block.
PiperOrigin-RevId: 1031195485
copybara-service
Bot
force-pushed
the
cl/1024374780
branch
from
November 27, 2026 12:51
2376288 to
add6dfc
Compare
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.
cmake: Align CMake build with pybind11_abseil (CMake 3.22, C++17)
Update the CMake files to match
pybind11_abseil:CMP0135toNEW.pybind11_protobuf_build_tree_moduleto output extension modules directly in${CMAKE_CURRENT_BINARY_DIR}under multi-config generators and copy runtime DLLs next to.pydmodules on Windows.protobuf::libprotobufpublicly on generatedOBJECTproto targets (propagatingPROTOBUF_USE_DLLSandABSL_CONSUME_DLLon MSVC), setprotobuf_MSVC_STATIC_RUNTIMEtoOFF, place Windows build-time executables and DLLs under${CMAKE_BINARY_DIR}/binsoprotoc.exelocatesabseil_dll.dll, and add explicit inter-proto generation dependencies.PYBIND11_PROTOBUF_BUILD_TESTINGinCMakeLists.txtand remove the stalepybind11_abseilinstall()block.