File: CMakeLists.txt

package info (click to toggle)
opentelemetry-cpp 1.23.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,372 kB
  • sloc: cpp: 96,239; sh: 1,766; makefile: 36; python: 31
file content (26 lines) | stat: -rw-r--r-- 1,056 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

add_executable(metrics_ostream_example metrics_ostream.cc)

target_link_libraries(metrics_ostream_example
                      PRIVATE common_metrics_foo_library)

if(DEFINED OPENTELEMETRY_BUILD_DLL)
  target_compile_definitions(metrics_ostream_example
                             PRIVATE OPENTELEMETRY_BUILD_IMPORT_DLL)
  target_link_libraries(metrics_ostream_example
                        PRIVATE opentelemetry-cpp::opentelemetry_cpp)
else()
  target_link_libraries(
    metrics_ostream_example PRIVATE opentelemetry-cpp::metrics
                                    opentelemetry-cpp::ostream_metrics_exporter)
endif()

if(BUILD_TESTING)
  add_test(NAME examples.metrics_simple
           COMMAND "$<TARGET_FILE:metrics_ostream_example>")
  # Disable the metrics_simple example test due to sporadic segfaults on Windows
  # See https://github.com/open-telemetry/opentelemetry-cpp/issues/3458
  set_tests_properties(examples.metrics_simple PROPERTIES DISABLED TRUE)
endif()