Skip to content

Commit 1a4630c

Browse files
committed
Add warning message and CHANGELOG.
Adds warnings to inform users when the build type for `opentelemetry-proto` is automatically adjusted to maintain consistency with protobuf, potentially overriding the global `BUILD_SHARED_LIBS` setting.
1 parent 50fe53f commit 1a4630c

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ Increment the:
3838
* [CONFIGURATION] File configuration - console metric exporter
3939
[#3734](https://github.com/open-telemetry/opentelemetry-cpp/pull/3734)
4040

41+
* [CMAKE] Support build proto as shared lib on Windows
42+
[#3714](https://github.com/open-telemetry/opentelemetry-cpp/pull/3714)
43+
4144
New Features:
4245

4346
* [CONFIGURATION] Implement declarative configuration (config.yaml)

cmake/opentelemetry-proto.cmake

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,23 @@ if((NOT protobuf_lib_type STREQUAL "STATIC_LIBRARY")
289289
AND (NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS))
290290
list(APPEND OTELCPP_PROTO_TARGET_OPTIONS SHARED)
291291
set(OTELCPP_PROTO_LIB_TYPE "SHARED_LIBRARY")
292+
293+
if(DEFINED BUILD_SHARED_LIBS AND NOT BUILD_SHARED_LIBS)
294+
message(
295+
WARNING
296+
"Static protobuf libraries found, we force to building opentelemetry-proto as a static library to keep compatibility"
297+
)
298+
endif()
292299
else()
293300
list(APPEND OTELCPP_PROTO_TARGET_OPTIONS STATIC)
294301
set(OTELCPP_PROTO_LIB_TYPE "STATIC_LIBRARY")
302+
303+
if(DEFINED BUILD_SHARED_LIBS AND BUILD_SHARED_LIBS)
304+
message(
305+
WARNING
306+
"Shared protobuf libraries found, we force to building opentelemetry-proto as a shared library to keep compatibility"
307+
)
308+
endif()
295309
endif()
296310

297311
set(OPENTELEMETRY_PROTO_TARGETS opentelemetry_proto)

0 commit comments

Comments
 (0)