Commit 4edefc3
authored
### Rationale for this change
After commit cbd48a4 migrated `OpenTelemetry` from `ExternalProject` to `FetchContent`, the documentation build started failing with symbol redefinition errors:
```
error: redefinition of 'const google::protobuf::internal::MigrationSchema schemas []'
```
`FetchContent` integrates `OpenTelemetry` into the parent CMake configuration, causing it to inherit `CMAKE_UNITY_BUILD=ON`. Unity builds combine multiple `.pb.cc` files into a single compilation unit, which causes collision of `static` symbols (like `schemas[]` and `file_default_instances[]`) that exist in each `protobuf-generated` file.
### What changes are included in this PR?
Added `set(CMAKE_UNITY_BUILD FALSE)` in the `build_opentelemetry()` function in `cpp/cmake_modules/ThirdpartyToolchain.cmake` to disallow Unity build in `protobuf-generated` files.
### Are these changes tested?
Has to be tested via CI.
### Are there any user-facing changes?
No, dev-only.
* GitHub Issue: #48750
Authored-by: Hyukjin Kwon <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
1 parent 3cbc27a commit 4edefc3
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3726 | 3726 | | |
3727 | 3727 | | |
3728 | 3728 | | |
| 3729 | + | |
| 3730 | + | |
3729 | 3731 | | |
3730 | 3732 | | |
3731 | 3733 | | |
| |||
0 commit comments