From f5bacdfed6748f6ef26bc5e03adf8bea680546a2 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Thu, 20 Apr 2023 21:55:38 -0700 Subject: [PATCH 1/5] add cmake target options --- CMakeLists.txt | 11 +++++++++++ exporters/elasticsearch/CMakeLists.txt | 2 ++ exporters/jaeger/CMakeLists.txt | 2 ++ exporters/memory/CMakeLists.txt | 2 ++ exporters/ostream/CMakeLists.txt | 5 +++++ exporters/otlp/CMakeLists.txt | 11 +++++++++++ exporters/prometheus/CMakeLists.txt | 2 ++ exporters/zipkin/CMakeLists.txt | 2 ++ sdk/src/common/CMakeLists.txt | 2 ++ sdk/src/logs/CMakeLists.txt | 1 + sdk/src/metrics/CMakeLists.txt | 2 ++ sdk/src/resource/CMakeLists.txt | 2 ++ sdk/src/trace/CMakeLists.txt | 2 ++ sdk/src/version/CMakeLists.txt | 2 ++ 14 files changed, 48 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index eef100f164..aa7738aff0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -188,6 +188,9 @@ option(OTELCPP_MAINTAINER_MODE "Build in maintainer mode (-Wall -Werror)" OFF) option(WITH_OPENTRACING "Whether to include the Opentracing shim" OFF) +option(OTELCPP_VERSIONED_LIBS "Whether to generate the versioned shared libs" + OFF) + set(OTELCPP_PROTO_PATH "" CACHE PATH "Path to opentelemetry-proto") @@ -267,6 +270,14 @@ function(install_windows_deps) PARENT_SCOPE) endfunction() +function(set_target_version target_name) + if(OTELCPP_VERSIONED_LIBS) + set_target_properties( + ${target_name} PROPERTIES VERSION ${OPENTELEMETRY_VERSION} + SOVERSION ${OPENTELEMETRY_VERSION}) + endif() +endfunction() + if(WITH_JAEGER) if(WITH_NO_DEPRECATED_CODE) message(FATAL_ERROR "Jaeger is DEPRECATED.") diff --git a/exporters/elasticsearch/CMakeLists.txt b/exporters/elasticsearch/CMakeLists.txt index 94a12c62e0..d3da92e78d 100644 --- a/exporters/elasticsearch/CMakeLists.txt +++ b/exporters/elasticsearch/CMakeLists.txt @@ -7,6 +7,8 @@ add_library(opentelemetry_exporter_elasticsearch_logs set_target_properties(opentelemetry_exporter_elasticsearch_logs PROPERTIES EXPORT_NAME elasticsearch_log_record_exporter) +set_target_version(opentelemetry_exporter_elasticsearch_logs) + target_include_directories( opentelemetry_exporter_elasticsearch_logs PUBLIC "$" diff --git a/exporters/jaeger/CMakeLists.txt b/exporters/jaeger/CMakeLists.txt index a02fa7c3e5..c299453bf9 100644 --- a/exporters/jaeger/CMakeLists.txt +++ b/exporters/jaeger/CMakeLists.txt @@ -36,6 +36,8 @@ add_library(opentelemetry_exporter_jaeger_trace ${JAEGER_EXPORTER_SOURCES} set_target_properties(opentelemetry_exporter_jaeger_trace PROPERTIES EXPORT_NAME jaeger_trace_exporter) +set_target_version(opentelemetry_exporter_jaeger_trace) + target_include_directories( opentelemetry_exporter_jaeger_trace PUBLIC "$" diff --git a/exporters/memory/CMakeLists.txt b/exporters/memory/CMakeLists.txt index 36ddca5ac5..298e4dec71 100644 --- a/exporters/memory/CMakeLists.txt +++ b/exporters/memory/CMakeLists.txt @@ -12,6 +12,8 @@ target_include_directories( set_target_properties(opentelemetry_exporter_in_memory PROPERTIES EXPORT_NAME in_memory_span_exporter) +set_target_version(opentelemetry_exporter_in_memory) + target_link_libraries(opentelemetry_exporter_in_memory PUBLIC opentelemetry_trace) diff --git a/exporters/ostream/CMakeLists.txt b/exporters/ostream/CMakeLists.txt index a674de8442..bda6a03f4e 100644 --- a/exporters/ostream/CMakeLists.txt +++ b/exporters/ostream/CMakeLists.txt @@ -7,6 +7,8 @@ add_library(opentelemetry_exporter_ostream_span src/span_exporter.cc set_target_properties(opentelemetry_exporter_ostream_span PROPERTIES EXPORT_NAME ostream_span_exporter) +set_target_version(opentelemetry_exporter_ostream_span) + target_include_directories( opentelemetry_exporter_ostream_span PUBLIC "$") @@ -42,6 +44,9 @@ endif() # BUILD_TESTING add_library(opentelemetry_exporter_ostream_metrics src/metric_exporter.cc) set_target_properties(opentelemetry_exporter_ostream_metrics PROPERTIES EXPORT_NAME ostream_metrics_exporter) + +set_target_version(opentelemetry_exporter_ostream_metrics) + target_include_directories( opentelemetry_exporter_ostream_metrics PUBLIC "$") diff --git a/exporters/otlp/CMakeLists.txt b/exporters/otlp/CMakeLists.txt index eed80783ac..8ab053c9cc 100644 --- a/exporters/otlp/CMakeLists.txt +++ b/exporters/otlp/CMakeLists.txt @@ -8,6 +8,7 @@ add_library( src/otlp_metric_utils.cc) set_target_properties(opentelemetry_otlp_recordable PROPERTIES EXPORT_NAME otlp_recordable) +set_target_version(opentelemetry_otlp_recordable) target_include_directories( opentelemetry_otlp_recordable @@ -31,6 +32,8 @@ if(WITH_OTLP_GRPC) src/otlp_grpc_utils.cc) set_target_properties(opentelemetry_exporter_otlp_grpc_client PROPERTIES EXPORT_NAME otlp_grpc_client) + set_target_version(opentelemetry_exporter_otlp_grpc_client) + target_link_libraries( opentelemetry_exporter_otlp_grpc_client PUBLIC opentelemetry_sdk opentelemetry_ext opentelemetry_proto) @@ -57,6 +60,7 @@ if(WITH_OTLP_GRPC) set_target_properties(opentelemetry_exporter_otlp_grpc PROPERTIES EXPORT_NAME otlp_grpc_exporter) + set_target_version(opentelemetry_exporter_otlp_grpc) target_link_libraries( opentelemetry_exporter_otlp_grpc @@ -72,6 +76,7 @@ if(WITH_OTLP_GRPC) set_target_properties(opentelemetry_exporter_otlp_grpc_log PROPERTIES EXPORT_NAME otlp_grpc_log_record_exporter) + set_target_version(opentelemetry_exporter_otlp_grpc_log) target_link_libraries( opentelemetry_exporter_otlp_grpc_log @@ -86,6 +91,7 @@ if(WITH_OTLP_GRPC) set_target_properties(opentelemetry_exporter_otlp_grpc_metrics PROPERTIES EXPORT_NAME otlp_grpc_metrics_exporter) + set_target_version(opentelemetry_exporter_otlp_grpc_metrics) target_link_libraries( opentelemetry_exporter_otlp_grpc_metrics @@ -100,6 +106,8 @@ if(WITH_OTLP_HTTP) add_library(opentelemetry_exporter_otlp_http_client src/otlp_http_client.cc) set_target_properties(opentelemetry_exporter_otlp_http_client PROPERTIES EXPORT_NAME otlp_http_client) + set_target_version(opentelemetry_exporter_otlp_http_client) + target_link_libraries( opentelemetry_exporter_otlp_http_client PUBLIC opentelemetry_sdk opentelemetry_proto opentelemetry_http_client_curl @@ -121,6 +129,7 @@ if(WITH_OTLP_HTTP) set_target_properties(opentelemetry_exporter_otlp_http PROPERTIES EXPORT_NAME otlp_http_exporter) + set_target_version(opentelemetry_exporter_otlp_http) target_link_libraries( opentelemetry_exporter_otlp_http @@ -137,6 +146,7 @@ if(WITH_OTLP_HTTP) set_target_properties(opentelemetry_exporter_otlp_http_log PROPERTIES EXPORT_NAME otlp_http_log_record_exporter) + set_target_version(opentelemetry_exporter_otlp_http_log) target_link_libraries( opentelemetry_exporter_otlp_http_log @@ -152,6 +162,7 @@ if(WITH_OTLP_HTTP) set_target_properties(opentelemetry_exporter_otlp_http_metric PROPERTIES EXPORT_NAME otlp_http_metric_exporter) + set_target_version(opentelemetry_exporter_otlp_http_metric) target_link_libraries( opentelemetry_exporter_otlp_http_metric diff --git a/exporters/prometheus/CMakeLists.txt b/exporters/prometheus/CMakeLists.txt index 1e6c79e376..806ca01f70 100644 --- a/exporters/prometheus/CMakeLists.txt +++ b/exporters/prometheus/CMakeLists.txt @@ -11,6 +11,8 @@ add_library(opentelemetry_exporter_prometheus src/exporter.cc src/collector.cc set_target_properties(opentelemetry_exporter_prometheus PROPERTIES EXPORT_NAME prometheus_exporter) +set_target_version(opentelemetry_exporter_prometheus) + target_include_directories( opentelemetry_exporter_prometheus PUBLIC "$" diff --git a/exporters/zipkin/CMakeLists.txt b/exporters/zipkin/CMakeLists.txt index 9cc997023f..60f8a80a2a 100644 --- a/exporters/zipkin/CMakeLists.txt +++ b/exporters/zipkin/CMakeLists.txt @@ -12,6 +12,8 @@ target_include_directories( PUBLIC "$" "$") +set_target_version(opentelemetry_exporter_zipkin_trace) + target_link_libraries( opentelemetry_exporter_zipkin_trace PUBLIC opentelemetry_trace opentelemetry_http_client_curl diff --git a/sdk/src/common/CMakeLists.txt b/sdk/src/common/CMakeLists.txt index b23a93e80c..24e9af523b 100644 --- a/sdk/src/common/CMakeLists.txt +++ b/sdk/src/common/CMakeLists.txt @@ -12,6 +12,8 @@ add_library(opentelemetry_common ${COMMON_SRCS}) set_target_properties(opentelemetry_common PROPERTIES EXPORT_NAME common) +set_target_version(opentelemetry_common) + target_link_libraries( opentelemetry_common PUBLIC opentelemetry_api opentelemetry_sdk Threads::Threads) diff --git a/sdk/src/logs/CMakeLists.txt b/sdk/src/logs/CMakeLists.txt index 2b7db6eb7c..e235e50696 100644 --- a/sdk/src/logs/CMakeLists.txt +++ b/sdk/src/logs/CMakeLists.txt @@ -26,6 +26,7 @@ set_target_properties(opentelemetry_logs PROPERTIES EXPORT_NAME logs) target_link_libraries(opentelemetry_logs PUBLIC opentelemetry_resources opentelemetry_common) +set_target_version(opentelemetry_logs) target_include_directories( opentelemetry_logs diff --git a/sdk/src/metrics/CMakeLists.txt b/sdk/src/metrics/CMakeLists.txt index f53639332b..65399b5b71 100644 --- a/sdk/src/metrics/CMakeLists.txt +++ b/sdk/src/metrics/CMakeLists.txt @@ -23,6 +23,8 @@ add_library( set_target_properties(opentelemetry_metrics PROPERTIES EXPORT_NAME metrics) +set_target_version(opentelemetry_metrics) + target_link_libraries(opentelemetry_metrics PUBLIC opentelemetry_common) target_include_directories( diff --git a/sdk/src/resource/CMakeLists.txt b/sdk/src/resource/CMakeLists.txt index f39b6f2a8f..49ebab30e0 100644 --- a/sdk/src/resource/CMakeLists.txt +++ b/sdk/src/resource/CMakeLists.txt @@ -5,6 +5,8 @@ add_library(opentelemetry_resources resource.cc resource_detector.cc) set_target_properties(opentelemetry_resources PROPERTIES EXPORT_NAME resources) +set_target_version(opentelemetry_resources) + target_link_libraries(opentelemetry_resources opentelemetry_common) target_include_directories( diff --git a/sdk/src/trace/CMakeLists.txt b/sdk/src/trace/CMakeLists.txt index 94c2059548..10a4fe12c1 100644 --- a/sdk/src/trace/CMakeLists.txt +++ b/sdk/src/trace/CMakeLists.txt @@ -24,6 +24,8 @@ add_library( set_target_properties(opentelemetry_trace PROPERTIES EXPORT_NAME trace) +set_target_version(opentelemetry_trace) + target_link_libraries(opentelemetry_trace PUBLIC opentelemetry_common opentelemetry_resources) diff --git a/sdk/src/version/CMakeLists.txt b/sdk/src/version/CMakeLists.txt index d8c48ed96d..cee103867c 100644 --- a/sdk/src/version/CMakeLists.txt +++ b/sdk/src/version/CMakeLists.txt @@ -5,6 +5,8 @@ add_library(opentelemetry_version version.cc) set_target_properties(opentelemetry_version PROPERTIES EXPORT_NAME version) +set_target_version(opentelemetry_version) + target_link_libraries(opentelemetry_version PUBLIC opentelemetry_api opentelemetry_sdk) From 5c66befacafb0295742a033bd40292da89985dfb Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Thu, 20 Apr 2023 22:20:40 -0700 Subject: [PATCH 2/5] more files --- CMakeLists.txt | 2 +- examples/common/foo_library/CMakeLists.txt | 2 ++ examples/common/logs_foo_library/CMakeLists.txt | 2 ++ examples/common/metrics_foo_library/CMakeLists.txt | 1 + exporters/elasticsearch/CMakeLists.txt | 1 - exporters/jaeger/CMakeLists.txt | 1 - exporters/memory/CMakeLists.txt | 1 - exporters/ostream/CMakeLists.txt | 1 - ext/src/http/client/curl/CMakeLists.txt | 1 + ext/src/zpages/CMakeLists.txt | 1 + opentracing-shim/CMakeLists.txt | 1 + 11 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aa7738aff0..f796bbc1ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -274,7 +274,7 @@ function(set_target_version target_name) if(OTELCPP_VERSIONED_LIBS) set_target_properties( ${target_name} PROPERTIES VERSION ${OPENTELEMETRY_VERSION} - SOVERSION ${OPENTELEMETRY_VERSION}) + SOVERSION ${OPENTELEMETRY_ABI_VERSION_NO}) endif() endfunction() diff --git a/examples/common/foo_library/CMakeLists.txt b/examples/common/foo_library/CMakeLists.txt index cceb200596..1ef87df1e1 100644 --- a/examples/common/foo_library/CMakeLists.txt +++ b/examples/common/foo_library/CMakeLists.txt @@ -6,5 +6,7 @@ if(DEFINED OPENTELEMETRY_BUILD_DLL) endif() add_library(common_foo_library foo_library.h foo_library.cc) +set_target_version(common_foo_library) + target_link_libraries(common_foo_library PUBLIC ${CMAKE_THREAD_LIBS_INIT} opentelemetry_api) diff --git a/examples/common/logs_foo_library/CMakeLists.txt b/examples/common/logs_foo_library/CMakeLists.txt index 45fe112f4e..6fd9c79d85 100644 --- a/examples/common/logs_foo_library/CMakeLists.txt +++ b/examples/common/logs_foo_library/CMakeLists.txt @@ -6,5 +6,7 @@ if(DEFINED OPENTELEMETRY_BUILD_DLL) endif() add_library(common_logs_foo_library foo_library.h foo_library.cc) +set_target_version(common_logs_foo_library) + target_link_libraries(common_logs_foo_library PUBLIC ${CMAKE_THREAD_LIBS_INIT} opentelemetry_api) diff --git a/examples/common/metrics_foo_library/CMakeLists.txt b/examples/common/metrics_foo_library/CMakeLists.txt index e4f73fe037..a91b2595b8 100644 --- a/examples/common/metrics_foo_library/CMakeLists.txt +++ b/examples/common/metrics_foo_library/CMakeLists.txt @@ -2,4 +2,5 @@ # SPDX-License-Identifier: Apache-2.0 add_library(common_metrics_foo_library foo_library.h foo_library.cc) +set_target_version(common_metrics_foo_library) target_link_libraries(common_metrics_foo_library PUBLIC opentelemetry_api) diff --git a/exporters/elasticsearch/CMakeLists.txt b/exporters/elasticsearch/CMakeLists.txt index d3da92e78d..e91b53f1c6 100644 --- a/exporters/elasticsearch/CMakeLists.txt +++ b/exporters/elasticsearch/CMakeLists.txt @@ -6,7 +6,6 @@ add_library(opentelemetry_exporter_elasticsearch_logs set_target_properties(opentelemetry_exporter_elasticsearch_logs PROPERTIES EXPORT_NAME elasticsearch_log_record_exporter) - set_target_version(opentelemetry_exporter_elasticsearch_logs) target_include_directories( diff --git a/exporters/jaeger/CMakeLists.txt b/exporters/jaeger/CMakeLists.txt index c299453bf9..222084eeb7 100644 --- a/exporters/jaeger/CMakeLists.txt +++ b/exporters/jaeger/CMakeLists.txt @@ -35,7 +35,6 @@ add_library(opentelemetry_exporter_jaeger_trace ${JAEGER_EXPORTER_SOURCES} set_target_properties(opentelemetry_exporter_jaeger_trace PROPERTIES EXPORT_NAME jaeger_trace_exporter) - set_target_version(opentelemetry_exporter_jaeger_trace) target_include_directories( diff --git a/exporters/memory/CMakeLists.txt b/exporters/memory/CMakeLists.txt index 298e4dec71..3dff044018 100644 --- a/exporters/memory/CMakeLists.txt +++ b/exporters/memory/CMakeLists.txt @@ -11,7 +11,6 @@ target_include_directories( set_target_properties(opentelemetry_exporter_in_memory PROPERTIES EXPORT_NAME in_memory_span_exporter) - set_target_version(opentelemetry_exporter_in_memory) target_link_libraries(opentelemetry_exporter_in_memory diff --git a/exporters/ostream/CMakeLists.txt b/exporters/ostream/CMakeLists.txt index bda6a03f4e..40713e4148 100644 --- a/exporters/ostream/CMakeLists.txt +++ b/exporters/ostream/CMakeLists.txt @@ -6,7 +6,6 @@ add_library(opentelemetry_exporter_ostream_span src/span_exporter.cc set_target_properties(opentelemetry_exporter_ostream_span PROPERTIES EXPORT_NAME ostream_span_exporter) - set_target_version(opentelemetry_exporter_ostream_span) target_include_directories( diff --git a/ext/src/http/client/curl/CMakeLists.txt b/ext/src/http/client/curl/CMakeLists.txt index 6684c5f820..96e7c5b42a 100644 --- a/ext/src/http/client/curl/CMakeLists.txt +++ b/ext/src/http/client/curl/CMakeLists.txt @@ -7,6 +7,7 @@ add_library( set_target_properties(opentelemetry_http_client_curl PROPERTIES EXPORT_NAME http_client_curl) +set_target_version(opentelemetry_http_client_curl) if(TARGET CURL::libcurl) target_link_libraries( diff --git a/ext/src/zpages/CMakeLists.txt b/ext/src/zpages/CMakeLists.txt index 5237d2da9b..8ff225112b 100644 --- a/ext/src/zpages/CMakeLists.txt +++ b/ext/src/zpages/CMakeLists.txt @@ -12,6 +12,7 @@ add_library( ../../include/opentelemetry/ext/zpages/tracez_http_server.h) set_target_properties(opentelemetry_zpages PROPERTIES EXPORT_NAME zpages) +set_target_version(opentelemetry_zpages) target_link_libraries(opentelemetry_zpages PUBLIC opentelemetry_ext opentelemetry_trace) diff --git a/opentracing-shim/CMakeLists.txt b/opentracing-shim/CMakeLists.txt index 3a57ac07bf..5f83de5474 100644 --- a/opentracing-shim/CMakeLists.txt +++ b/opentracing-shim/CMakeLists.txt @@ -7,6 +7,7 @@ add_library(${this_target} src/shim_utils.cc src/span_shim.cc src/span_context_shim.cc src/tracer_shim.cc) set_target_properties(${this_target} PROPERTIES EXPORT_NAME opentracing_shim) +set_target_version(${this_target}) target_include_directories( ${this_target} PUBLIC "$" From 621b0be631b9e6a1bf5061bb7416db8c82fc692b Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Thu, 20 Apr 2023 22:25:32 -0700 Subject: [PATCH 3/5] changes... --- exporters/ostream/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exporters/ostream/CMakeLists.txt b/exporters/ostream/CMakeLists.txt index 40713e4148..af24e9f1ad 100644 --- a/exporters/ostream/CMakeLists.txt +++ b/exporters/ostream/CMakeLists.txt @@ -43,7 +43,6 @@ endif() # BUILD_TESTING add_library(opentelemetry_exporter_ostream_metrics src/metric_exporter.cc) set_target_properties(opentelemetry_exporter_ostream_metrics PROPERTIES EXPORT_NAME ostream_metrics_exporter) - set_target_version(opentelemetry_exporter_ostream_metrics) target_include_directories( @@ -80,6 +79,8 @@ if(WITH_LOGS_PREVIEW) add_library(opentelemetry_exporter_ostream_logs src/log_record_exporter.cc) set_target_properties(opentelemetry_exporter_ostream_logs PROPERTIES EXPORT_NAME ostream_log_record_exporter) + set_target_version(opentelemetry_exporter_ostream_logs) + target_include_directories( opentelemetry_exporter_ostream_logs PUBLIC "$") From 89c16d6b1b91072a0c1f80512f1c1a081fe2e0f1 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Thu, 20 Apr 2023 22:28:23 -0700 Subject: [PATCH 4/5] changes --- sdk/src/common/CMakeLists.txt | 1 - sdk/src/metrics/CMakeLists.txt | 1 - sdk/src/resource/CMakeLists.txt | 1 - sdk/src/trace/CMakeLists.txt | 1 - sdk/src/version/CMakeLists.txt | 1 - 5 files changed, 5 deletions(-) diff --git a/sdk/src/common/CMakeLists.txt b/sdk/src/common/CMakeLists.txt index 24e9af523b..7bb645f5b7 100644 --- a/sdk/src/common/CMakeLists.txt +++ b/sdk/src/common/CMakeLists.txt @@ -11,7 +11,6 @@ endif() add_library(opentelemetry_common ${COMMON_SRCS}) set_target_properties(opentelemetry_common PROPERTIES EXPORT_NAME common) - set_target_version(opentelemetry_common) target_link_libraries( diff --git a/sdk/src/metrics/CMakeLists.txt b/sdk/src/metrics/CMakeLists.txt index 65399b5b71..7ee82c9cd5 100644 --- a/sdk/src/metrics/CMakeLists.txt +++ b/sdk/src/metrics/CMakeLists.txt @@ -22,7 +22,6 @@ add_library( sync_instruments.cc) set_target_properties(opentelemetry_metrics PROPERTIES EXPORT_NAME metrics) - set_target_version(opentelemetry_metrics) target_link_libraries(opentelemetry_metrics PUBLIC opentelemetry_common) diff --git a/sdk/src/resource/CMakeLists.txt b/sdk/src/resource/CMakeLists.txt index 49ebab30e0..1a0510f678 100644 --- a/sdk/src/resource/CMakeLists.txt +++ b/sdk/src/resource/CMakeLists.txt @@ -4,7 +4,6 @@ add_library(opentelemetry_resources resource.cc resource_detector.cc) set_target_properties(opentelemetry_resources PROPERTIES EXPORT_NAME resources) - set_target_version(opentelemetry_resources) target_link_libraries(opentelemetry_resources opentelemetry_common) diff --git a/sdk/src/trace/CMakeLists.txt b/sdk/src/trace/CMakeLists.txt index 10a4fe12c1..52c109acb8 100644 --- a/sdk/src/trace/CMakeLists.txt +++ b/sdk/src/trace/CMakeLists.txt @@ -23,7 +23,6 @@ add_library( random_id_generator_factory.cc) set_target_properties(opentelemetry_trace PROPERTIES EXPORT_NAME trace) - set_target_version(opentelemetry_trace) target_link_libraries(opentelemetry_trace PUBLIC opentelemetry_common diff --git a/sdk/src/version/CMakeLists.txt b/sdk/src/version/CMakeLists.txt index cee103867c..f7be858000 100644 --- a/sdk/src/version/CMakeLists.txt +++ b/sdk/src/version/CMakeLists.txt @@ -4,7 +4,6 @@ add_library(opentelemetry_version version.cc) set_target_properties(opentelemetry_version PROPERTIES EXPORT_NAME version) - set_target_version(opentelemetry_version) target_link_libraries(opentelemetry_version PUBLIC opentelemetry_api From 385861afdf2d7c0c5d7ac94db05a67fff447ebfc Mon Sep 17 00:00:00 2001 From: Lalit Date: Fri, 21 Apr 2023 10:15:28 -0700 Subject: [PATCH 5/5] fix --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f796bbc1ab..50dae57339 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -191,6 +191,10 @@ option(WITH_OPENTRACING "Whether to include the Opentracing shim" OFF) option(OTELCPP_VERSIONED_LIBS "Whether to generate the versioned shared libs" OFF) +if(OTELCPP_VERSIONED_LIBS AND NOT BUILD_SHARED_LIBS) + message(FATAL_ERROR "OTELCPP_VERSIONED_LIBS=ON requires BUILD_SHARED_LIBS=ON") +endif() + set(OTELCPP_PROTO_PATH "" CACHE PATH "Path to opentelemetry-proto")