Skip to content

cmake: Align CMake build with pybind11_abseil (CMake 3.22, C++17) - #264

Merged
copybara-service[bot] merged 1 commit into
mainfrom
cl/1024374780
Nov 27, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
cl/1024374780

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

cmake: Align CMake build with pybind11_abseil (CMake 3.22, C++17)

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.

@copybara-service
copybara-service Bot force-pushed the cl/1024374780 branch 3 times, most recently from 021eaf4 to 2376288 Compare November 27, 2026 12:35
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
copybara-service Bot merged commit add6dfc into main Nov 27, 2026
18 checks passed
@copybara-service
copybara-service Bot deleted the cl/1024374780 branch November 27, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant