@@ -60,7 +60,8 @@ if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
6060endif ()
6161
6262otelcpp_option_flag (OTELCPP_WITH_ABI_VERSION_1 "ABI version 1" ON )
63- otelcpp_option_flag (OTELCPP_WITH_ABI_VERSION_2 "EXPERIMENTAL: ABI version 2 preview" OFF )
63+ otelcpp_option_flag (OTELCPP_WITH_ABI_VERSION_2
64+ "EXPERIMENTAL: ABI version 2 preview" OFF )
6465
6566set (_OTELCPP_WITH_METRICS_BOUND_INSTRUMENTS_PREVIEW_REQUESTED OFF )
6667if (DEFINED OTELCPP_WITH_METRICS_BOUND_INSTRUMENTS_PREVIEW)
@@ -74,20 +75,21 @@ if(_OTELCPP_WITH_METRICS_BOUND_INSTRUMENTS_PREVIEW_REQUESTED
7475 AND NOT OTELCPP_WITH_ABI_VERSION_2)
7576 message (
7677 FATAL_ERROR
77- "OTELCPP_WITH_METRICS_BOUND_INSTRUMENTS_PREVIEW requires OTELCPP_WITH_ABI_VERSION_2" )
78+ "OTELCPP_WITH_METRICS_BOUND_INSTRUMENTS_PREVIEW requires OTELCPP_WITH_ABI_VERSION_2"
79+ )
7880endif ()
7981unset (_OTELCPP_WITH_METRICS_BOUND_INSTRUMENTS_PREVIEW_REQUESTED)
8082
81-
8283# Experimental: bound synchronous metric instruments (Counter, Histogram).
83- # Requires OTELCPP_WITH_ABI_VERSION_2. Context-bearing bound operations, exemplar
84- # parity, Gauge, and UpDownCounter bound support are follow-ups.
84+ # Requires OTELCPP_WITH_ABI_VERSION_2. Context-bearing bound operations,
85+ # exemplar parity, Gauge, and UpDownCounter bound support are follow-ups.
8586otelcpp_dependent_option (
8687 OTELCPP_WITH_METRICS_BOUND_INSTRUMENTS_PREVIEW
8788 "EXPERIMENTAL: bound synchronous metric instruments preview" OFF
8889 "OTELCPP_WITH_ABI_VERSION_2" OFF )
8990
90- otelcpp_option_flag (OTELCPP_WITH_CONFIGURATION "EXPERIMENTAL: YAML configuration file" OFF )
91+ otelcpp_option_flag (OTELCPP_WITH_CONFIGURATION
92+ "EXPERIMENTAL: YAML configuration file" OFF )
9193
9294#
9395# We do not want to have OTELCPP_WITH_ABI_VERSION = "1" or "2", and instead
@@ -111,7 +113,9 @@ if(OTELCPP_WITH_ABI_VERSION_1 AND OTELCPP_WITH_ABI_VERSION_2)
111113 # Only one ABI is supported in a build.
112114 #
113115 message (
114- FATAL_ERROR "Set either OTELCPP_WITH_ABI_VERSION_1 or OTELCPP_WITH_ABI_VERSION_2, not both" )
116+ FATAL_ERROR
117+ "Set either OTELCPP_WITH_ABI_VERSION_1 or OTELCPP_WITH_ABI_VERSION_2, not both"
118+ )
115119endif ()
116120
117121if (OTELCPP_WITH_ABI_VERSION_2)
@@ -122,28 +126,30 @@ else()
122126 set (OPENTELEMETRY_ABI_VERSION_NO "${OPENTELEMETRY_ABI_VERSION_DEFAULT} " )
123127endif ()
124128
125- if (OTELCPP_WITH_METRICS_BOUND_INSTRUMENTS_PREVIEW AND NOT OTELCPP_WITH_ABI_VERSION_2)
129+ if (OTELCPP_WITH_METRICS_BOUND_INSTRUMENTS_PREVIEW
130+ AND NOT OTELCPP_WITH_ABI_VERSION_2)
126131 message (
127132 FATAL_ERROR
128- "OTELCPP_WITH_METRICS_BOUND_INSTRUMENTS_PREVIEW requires OTELCPP_WITH_ABI_VERSION_2" )
133+ "OTELCPP_WITH_METRICS_BOUND_INSTRUMENTS_PREVIEW requires OTELCPP_WITH_ABI_VERSION_2"
134+ )
129135endif ()
130136
131- otelcpp_option_flag (OTELCPP_WITH_NO_DEPRECATED_CODE "Do not include deprecated code" OFF )
137+ otelcpp_option_flag (OTELCPP_WITH_NO_DEPRECATED_CODE
138+ "Do not include deprecated code" OFF )
132139
133- otelcpp_option_variable (
134- OTELCPP_WITH_STL "OFF" STRING
135- "Which version of the Standard Library for C++ to use" )
140+ otelcpp_option_variable (OTELCPP_WITH_STL "OFF" STRING
141+ "Which version of the Standard Library for C++ to use" )
136142
137- otelcpp_option_flag (OTELCPP_WITH_GSL
138- "Whether to use Guidelines Support Library for C++ latest features" OFF )
143+ otelcpp_option_flag (
144+ OTELCPP_WITH_GSL
145+ "Whether to use Guidelines Support Library for C++ latest features" OFF )
139146
140147set (OTELCPP_INSTALL_DEFAULT ON )
141148if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
142149 set (OTELCPP_INSTALL_DEFAULT OFF )
143150endif ()
144151otelcpp_option_flag (OTELCPP_INSTALL "Whether to install opentelemetry targets"
145- ${OTELCPP_INSTALL_DEFAULT} )
146-
152+ ${OTELCPP_INSTALL_DEFAULT} )
147153
148154if (NOT OTELCPP_WITH_STL STREQUAL "OFF" )
149155 # These definitions are needed for test projects that do not link against
@@ -164,22 +170,24 @@ if(NOT OTELCPP_WITH_STL STREQUAL "OFF")
164170 endif ()
165171endif ()
166172
167- otelcpp_option_flag (OTELCPP_WITH_OTLP_RETRY_PREVIEW "Whether to enable retry functionality" ON )
173+ otelcpp_option_flag (OTELCPP_WITH_OTLP_RETRY_PREVIEW
174+ "Whether to enable retry functionality" ON )
168175
169176otelcpp_option_flag (OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW
170- "Whether to enable mTLS support for gRPC" ON )
177+ "Whether to enable mTLS support for gRPC" ON )
171178
172- otelcpp_option_flag (OTELCPP_WITH_OTLP_GRPC_CREDENTIAL_PREVIEW
173- "Whether to enable gRPC credentials option in OTLP gRPC Exporter" OFF )
179+ otelcpp_option_flag (
180+ OTELCPP_WITH_OTLP_GRPC_CREDENTIAL_PREVIEW
181+ "Whether to enable gRPC credentials option in OTLP gRPC Exporter" OFF )
174182
175- otelcpp_option_flag (OTELCPP_WITH_OTLP_GRPC "Whether to include the OTLP gRPC exporter in the SDK"
176- OFF )
183+ otelcpp_option_flag (OTELCPP_WITH_OTLP_GRPC
184+ "Whether to include the OTLP gRPC exporter in the SDK" OFF )
177185
178- otelcpp_option_flag (OTELCPP_WITH_OTLP_HTTP "Whether to include the OTLP http exporter in the SDK"
179- OFF )
186+ otelcpp_option_flag (OTELCPP_WITH_OTLP_HTTP
187+ "Whether to include the OTLP http exporter in the SDK" OFF )
180188
181- otelcpp_option_flag (OTELCPP_WITH_OTLP_FILE "Whether to include the OTLP file exporter in the SDK"
182- OFF )
189+ otelcpp_option_flag (OTELCPP_WITH_OTLP_FILE
190+ "Whether to include the OTLP file exporter in the SDK" OFF )
183191
184192otelcpp_option_flag (
185193 OTELCPP_WITH_OTLP_HTTP_COMPRESSION
@@ -190,21 +198,24 @@ otelcpp_option_flag(
190198 OTELCPP_WITH_OTLP_UTF8_VALIDITY
191199 "Whether to enable UTF-8 validity checks for the OTLP exporter in the SDK" ON )
192200
193- otelcpp_option_flag (OTELCPP_WITH_CURL_LOGGING "Whether to enable select CURL verbosity in OTel logs"
194- OFF )
201+ otelcpp_option_flag (OTELCPP_WITH_CURL_LOGGING
202+ "Whether to enable select CURL verbosity in OTel logs" OFF )
195203
196- otelcpp_option_flag (OTELCPP_WITH_ZIPKIN "Whether to include the Zipkin exporter in the SDK" OFF )
204+ otelcpp_option_flag (OTELCPP_WITH_ZIPKIN
205+ "Whether to include the Zipkin exporter in the SDK" OFF )
197206
198- otelcpp_option_flag (OTELCPP_WITH_PROMETHEUS "Whether to include the Prometheus Client in the SDK"
199- OFF )
207+ otelcpp_option_flag (OTELCPP_WITH_PROMETHEUS
208+ "Whether to include the Prometheus Client in the SDK" OFF )
200209
201- otelcpp_option_flag (OTELCPP_WITH_ELASTICSEARCH
202- "Whether to include the Elasticsearch Client in the SDK" OFF )
210+ otelcpp_option_flag (
211+ OTELCPP_WITH_ELASTICSEARCH
212+ "Whether to include the Elasticsearch Client in the SDK" OFF )
203213
204- otelcpp_option_flag (OTELCPP_WITH_NO_GETENV "Whether the platform supports environment variables" OFF )
214+ otelcpp_option_flag (OTELCPP_WITH_NO_GETENV
215+ "Whether the platform supports environment variables" OFF )
205216
206- # BUILD_TESTING is a standard CMake variable, so use it only as the
207- # top-level default and do not treat it as a deprecated alias.
217+ # BUILD_TESTING is a standard CMake variable, so use it only as the top-level
218+ # default and do not treat it as a deprecated alias.
208219if (CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR )
209220 if (DEFINED BUILD_TESTING)
210221 option (OTELCPP_BUILD_TESTING "Whether to enable tests" "${BUILD_TESTING} " )
@@ -215,22 +226,25 @@ else()
215226 option (OTELCPP_BUILD_TESTING "Whether to enable tests" OFF )
216227endif ()
217228
218- otelcpp_option_flag (OTELCPP_WITH_BENCHMARK "Whether to build benchmark program" ON )
229+ otelcpp_option_flag (OTELCPP_WITH_BENCHMARK "Whether to build benchmark program"
230+ ON )
219231
220- otelcpp_option_flag (OTELCPP_BUILD_W3CTRACECONTEXT_TEST "Whether to build w3c trace context" OFF )
232+ otelcpp_option_flag (OTELCPP_BUILD_W3CTRACECONTEXT_TEST
233+ "Whether to build w3c trace context" OFF )
221234
222- otelcpp_option_flag (OTELCPP_MAINTAINER_MODE "Build in maintainer mode (-Wall -Werror)" OFF )
235+ otelcpp_option_flag (OTELCPP_MAINTAINER_MODE
236+ "Build in maintainer mode (-Wall -Werror)" OFF )
223237
224- otelcpp_option_flag (OTELCPP_WITH_OPENTRACING "Whether to include the Opentracing shim" OFF )
238+ otelcpp_option_flag (OTELCPP_WITH_OPENTRACING
239+ "Whether to include the Opentracing shim" OFF )
225240
226- otelcpp_option_flag (OTELCPP_VERSIONED_LIBS "Whether to generate the versioned shared libs"
227- OFF )
241+ otelcpp_option_flag (OTELCPP_VERSIONED_LIBS
242+ "Whether to generate the versioned shared libs" OFF )
228243otelcpp_option_flag (
229244 OTELCPP_BUILD_DLL
230245 "Whether to build the OpenTelemetry C++ SDK as a Windows DLL" OFF )
231246
232- otelcpp_option_flag (OTELCPP_BUILD_PACKAGE "Whether to generate a package"
233- OFF )
247+ otelcpp_option_flag (OTELCPP_BUILD_PACKAGE "Whether to generate a package" OFF )
234248
235249otelcpp_option_variable (
236250 OTELCPP_EXTERNAL_COMPONENT_PATH "" STRING
@@ -241,7 +255,8 @@ if(OTELCPP_VERSIONED_LIBS AND NOT BUILD_SHARED_LIBS)
241255endif ()
242256
243257if (WIN32 )
244- otelcpp_option_flag (OTELCPP_WITH_ETW "Whether to include the ETW Exporter in the SDK" ON )
258+ otelcpp_option_flag (OTELCPP_WITH_ETW
259+ "Whether to include the ETW Exporter in the SDK" ON )
245260else ()
246261 if (DEFINED OTELCPP_WITH_ETW OR DEFINED WITH_ETW)
247262 message (FATAL_ERROR "OTELCPP_WITH_ETW is only supported on Windows" )
@@ -265,24 +280,26 @@ otelcpp_option_flag(
265280 "Whether to build http client/server examples. Requires OTELCPP_WITH_EXAMPLES and CURL"
266281 OFF )
267282
268- otelcpp_option_flag (OTELCPP_WITH_FUNC_TESTS "Whether to build functional tests" ON )
283+ otelcpp_option_flag (OTELCPP_WITH_FUNC_TESTS "Whether to build functional tests"
284+ ON )
269285
270- otelcpp_option_flag (OTELCPP_WITH_ASYNC_EXPORT_PREVIEW "Whether to enable async export" OFF )
286+ otelcpp_option_flag (OTELCPP_WITH_ASYNC_EXPORT_PREVIEW
287+ "Whether to enable async export" OFF )
271288
272289# Exemplar specs status is experimental, so behind feature flag by default
273290otelcpp_option_flag (OTELCPP_WITH_METRICS_EXEMPLAR_PREVIEW
274- "Whether to enable exemplar within metrics" OFF )
291+ "Whether to enable exemplar within metrics" OFF )
275292
276293# Experimental, so behind feature flag by default
277294otelcpp_option_flag (OTELCPP_WITH_THREAD_INSTRUMENTATION_PREVIEW
278- "Whether to enable thread instrumentation" OFF )
295+ "Whether to enable thread instrumentation" OFF )
279296
280297otelcpp_option_flag (OTELCPP_WITH_RESOURCE_DETECTORS_PREVIEW
281- "Whether to enable inbuilt resource detectors" OFF )
298+ "Whether to enable inbuilt resource detectors" OFF )
282299
283- otelcpp_option_flag (OTELCPP_SKIP_DYNAMIC_LOADING_TESTS
284- "Whether to build test libraries that are always linked as shared libs"
285- OFF )
300+ otelcpp_option_flag (
301+ OTELCPP_SKIP_DYNAMIC_LOADING_TESTS
302+ "Whether to build test libraries that are always linked as shared libs" OFF )
286303
287304#
288305# Verify options dependencies
@@ -291,7 +308,9 @@ otelcpp_option_flag(OTELCPP_SKIP_DYNAMIC_LOADING_TESTS
291308include (FetchContent )
292309
293310if (OTELCPP_WITH_EXAMPLES_HTTP AND NOT OTELCPP_WITH_EXAMPLES)
294- message (FATAL_ERROR "OTELCPP_WITH_EXAMPLES_HTTP=ON requires OTELCPP_WITH_EXAMPLES=ON" )
311+ message (
312+ FATAL_ERROR
313+ "OTELCPP_WITH_EXAMPLES_HTTP=ON requires OTELCPP_WITH_EXAMPLES=ON" )
295314endif ()
296315
297316if (OTELCPP_WITH_GSL)
@@ -337,8 +356,8 @@ otelcpp_dependent_option(
337356 OFF )
338357
339358#
340- # Locally override options if OTELCPP_WITH_API_ONLY is set to prevent third party
341- # dependencies from being imported
359+ # Locally override options if OTELCPP_WITH_API_ONLY is set to prevent third
360+ # party dependencies from being imported
342361#
343362
344363if (OTELCPP_WITH_API_ONLY)
@@ -566,7 +585,8 @@ message(STATUS "---------------------------------------------")
566585message (STATUS "opentelemetry-cpp build options" )
567586message (STATUS "---------------------------------------------" )
568587message (STATUS "OTELCPP_WITH_API_ONLY: ${OTELCPP_WITH_API_ONLY} " )
569- message (STATUS "OTELCPP_WITH_NO_DEPRECATED_CODE: ${OTELCPP_WITH_NO_DEPRECATED_CODE} " )
588+ message (
589+ STATUS "OTELCPP_WITH_NO_DEPRECATED_CODE: ${OTELCPP_WITH_NO_DEPRECATED_CODE} " )
570590message (STATUS "OTELCPP_WITH_ABI_VERSION_1: ${OTELCPP_WITH_ABI_VERSION_1} " )
571591message (STATUS "OTELCPP_WITH_ABI_VERSION_2: ${OTELCPP_WITH_ABI_VERSION_2} " )
572592message (STATUS "OTELCPP_VERSIONED_LIBS: ${OTELCPP_VERSIONED_LIBS} " )
@@ -585,7 +605,8 @@ message(STATUS "---------------------------------------------")
585605message (STATUS "OTELCPP_WITH_OTLP_GRPC: ${OTELCPP_WITH_OTLP_GRPC} " )
586606message (STATUS "OTELCPP_WITH_OTLP_HTTP: ${OTELCPP_WITH_OTLP_HTTP} " )
587607message (STATUS "OTELCPP_WITH_OTLP_FILE: ${OTELCPP_WITH_OTLP_FILE} " )
588- message (STATUS "OTELCPP_WITH_HTTP_CLIENT_CURL: ${OTELCPP_WITH_HTTP_CLIENT_CURL} " )
608+ message (
609+ STATUS "OTELCPP_WITH_HTTP_CLIENT_CURL: ${OTELCPP_WITH_HTTP_CLIENT_CURL} " )
589610message (STATUS "OTELCPP_WITH_ZIPKIN: ${OTELCPP_WITH_ZIPKIN} " )
590611message (STATUS "OTELCPP_WITH_PROMETHEUS: ${OTELCPP_WITH_PROMETHEUS} " )
591612message (STATUS "OTELCPP_WITH_ELASTICSEARCH: ${OTELCPP_WITH_ELASTICSEARCH} " )
@@ -597,19 +618,27 @@ message(STATUS "OTELCPP_WITH_CONFIGURATION: ${OTELCPP_WITH_CONFIGURATION}")
597618message (STATUS "---------------------------------------------" )
598619message (STATUS "feature preview options" )
599620message (STATUS "---------------------------------------------" )
600- message (STATUS "OTELCPP_WITH_ASYNC_EXPORT_PREVIEW: ${OTELCPP_WITH_ASYNC_EXPORT_PREVIEW} " )
621+ message (
622+ STATUS
623+ "OTELCPP_WITH_ASYNC_EXPORT_PREVIEW: ${OTELCPP_WITH_ASYNC_EXPORT_PREVIEW} " )
601624message (
602625 STATUS
603626 "OTELCPP_WITH_THREAD_INSTRUMENTATION_PREVIEW: ${OTELCPP_WITH_THREAD_INSTRUMENTATION_PREVIEW} "
604627)
605628message (
606- STATUS "OTELCPP_WITH_METRICS_EXEMPLAR_PREVIEW: ${OTELCPP_WITH_METRICS_EXEMPLAR_PREVIEW} " )
629+ STATUS
630+ "OTELCPP_WITH_METRICS_EXEMPLAR_PREVIEW: ${OTELCPP_WITH_METRICS_EXEMPLAR_PREVIEW} "
631+ )
607632message (
608- STATUS "OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW: ${OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW} " )
633+ STATUS
634+ "OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW: ${OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW} "
635+ )
609636message (
610637 STATUS
611- "OTELCPP_WITH_OTLP_GRPC_CREDENTIAL_PREVIEW: ${OTELCPP_WITH_OTLP_GRPC_CREDENTIAL_PREVIEW} " )
612- message (STATUS "OTELCPP_WITH_OTLP_RETRY_PREVIEW: ${OTELCPP_WITH_OTLP_RETRY_PREVIEW} " )
638+ "OTELCPP_WITH_OTLP_GRPC_CREDENTIAL_PREVIEW: ${OTELCPP_WITH_OTLP_GRPC_CREDENTIAL_PREVIEW} "
639+ )
640+ message (
641+ STATUS "OTELCPP_WITH_OTLP_RETRY_PREVIEW: ${OTELCPP_WITH_OTLP_RETRY_PREVIEW} " )
613642message (
614643 STATUS
615644 "OTELCPP_WITH_METRICS_BOUND_INSTRUMENTS_PREVIEW: ${OTELCPP_WITH_METRICS_BOUND_INSTRUMENTS_PREVIEW} "
@@ -619,15 +648,19 @@ message(STATUS "third-party options")
619648message (STATUS "---------------------------------------------" )
620649message (STATUS "WITH_NLOHMANN_JSON: ${USE_NLOHMANN_JSON} " )
621650message (STATUS "OTELCPP_WITH_CURL_LOGGING: ${OTELCPP_WITH_CURL_LOGGING} " )
622- message (STATUS "OTELCPP_WITH_OTLP_HTTP_COMPRESSION: ${OTELCPP_WITH_OTLP_HTTP_COMPRESSION} " )
651+ message (
652+ STATUS
653+ "OTELCPP_WITH_OTLP_HTTP_COMPRESSION: ${OTELCPP_WITH_OTLP_HTTP_COMPRESSION} " )
623654message (STATUS "---------------------------------------------" )
624655message (STATUS "examples and test options" )
625656message (STATUS "---------------------------------------------" )
626657message (STATUS "OTELCPP_WITH_BENCHMARK: ${OTELCPP_WITH_BENCHMARK} " )
627658message (STATUS "OTELCPP_WITH_EXAMPLES: ${OTELCPP_WITH_EXAMPLES} " )
628659message (STATUS "OTELCPP_WITH_EXAMPLES_HTTP: ${OTELCPP_WITH_EXAMPLES_HTTP} " )
629660message (STATUS "OTELCPP_WITH_FUNC_TESTS: ${OTELCPP_WITH_FUNC_TESTS} " )
630- message (STATUS "OTELCPP_BUILD_W3CTRACECONTEXT_TEST: ${OTELCPP_BUILD_W3CTRACECONTEXT_TEST} " )
661+ message (
662+ STATUS
663+ "OTELCPP_BUILD_W3CTRACECONTEXT_TEST: ${OTELCPP_BUILD_W3CTRACECONTEXT_TEST} " )
631664message (STATUS "OTELCPP_BUILD_TESTING: ${OTELCPP_BUILD_TESTING} " )
632665message (STATUS "---------------------------------------------" )
633666message (STATUS "versions" )
0 commit comments