Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-DWITH_OTLP_FILE=ON -DWITH_EXAMPLES=ON is not compiling the file_metric_main.cc #3225

Open
SudhirKesti opened this issue Jan 3, 2025 · 0 comments
Labels
bug Something isn't working needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@SudhirKesti
Copy link

Describe your environment
Building opentlemetry-cpp with file exporter ON. Example code examples/otlp/file_metric_main.cc is not comipling.

Steps to reproduce
cmake -S . -B cmakebuilddir -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DWITH_OTLP_FILE=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DOPENTELEMETRY_INSTALL=ON -DWITH_EXAMPLES=ON

What is the expected behavior?
As -DWITH_OTLP_FILE and WITH_EXAMPLES are set to ON expected to compile the code examples/otlp/file_metric_main.cc

What is the actual behavior?
examples/otlp/file_metric_main.cc is copiled only when WITH_OTLP_GRPC OR WITH_OTLP_HTTP

Additional context
-- NA --

Patch to fix this:
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -3,7 +3,7 @@

add_subdirectory(common)
include_directories(common)
-if(WITH_OTLP_GRPC OR WITH_OTLP_HTTP)
+if(WITH_OTLP_GRPC OR WITH_OTLP_HTTP OR WITH_OTLP_FILE)
add_subdirectory(otlp)
endif()
if(WITH_OTLP_GRPC)

@SudhirKesti SudhirKesti added the bug Something isn't working label Jan 3, 2025
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jan 3, 2025
@SudhirKesti SudhirKesti changed the title -DWITH_OTLP_FILE=ON is not compiling the file_metric_main.cc -DWITH_OTLP_FILE=ON -DWITH_EXAMPLES=ON is not compiling the file_metric_main.cc Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

1 participant