Skip to content

Commit f8eaec3

Browse files
authored
otel build update for GCC 15 (#12180)
When building the opentelemetry plugin against GCC 15, we get a warning from a deprecated use of ciso646 in the library. No version of opentelemetry-cpp currently addresses this. The `-Wno-cpp` silences that warning. Here is the warning, for reference: ``` In file included from /opt/include/opentelemetry/nostd/internal/absl/base/options.h:73, from /opt/include/opentelemetry/nostd/internal/absl/base/config.h:66, from /opt/include/opentelemetry/nostd/internal/absl/types/variant.h:45, from /opt/include/opentelemetry/nostd/variant.h:52, from /opt/include/opentelemetry/common/attribute_value.h:10, from /opt/include/opentelemetry/sdk/trace/recordable.h:6, from /opt/include/opentelemetry/sdk/trace/exporter.h:9, from /opt/include/opentelemetry/exporters/otlp/otlp_http_exporter.h:7, from /home/bneradt/src/ts_edge/plugins/experimental/otel_tracer/tracer_common.h:18, from /home/bneradt/src/ts_edge/plugins/experimental/otel_tracer/otel_tracer.cc:40: /usr/include/c++/15/ciso646:46:4: error: #warning "<ciso646> is deprecated in C++17, use <version> to detect implementation-specific macros" [-Werror=cpp] 46 | # warning "<ciso646> is deprecated in C++17, use <version> to detect implementation-specific macros" | ^~~~~~~ ```
1 parent 6b2208f commit f8eaec3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

cmake/Findopentelemetry.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ if(opentelemetry_FOUND)
103103
if(APPLE)
104104
if(NOT TARGET opentelemetry::opentelemetry)
105105
add_library(opentelemetry::opentelemetry INTERFACE IMPORTED)
106+
target_compile_options(opentelemetry::opentelemetry INTERFACE -Wno-cpp)
106107
target_include_directories(opentelemetry::opentelemetry INTERFACE ${opentelemetry_INCLUDE_DIRS})
107108
target_link_libraries(opentelemetry::opentelemetry INTERFACE ${opentelemetry_found_LIBRARIES})
108109
list(APPEND opentelemetry_LIBRARIES opentelemetry::opentelemetry)
@@ -118,5 +119,6 @@ if(opentelemetry_FOUND)
118119
list(APPEND opentelemetry_LIBRARIES opentelemetry::${OTLIB})
119120
endif()
120121
endforeach()
122+
target_compile_options(opentelemetry::opentelemetry_trace INTERFACE -Wno-cpp)
121123
endif()
122124
endif()

0 commit comments

Comments
 (0)