-
Notifications
You must be signed in to change notification settings - Fork 501
[CONFIGURATION] File configuration - cmake build #3655
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e494b4e
[CONFIGURATION] File configuration - cmake build
marcalff d878f40
Add missing file.
marcalff 85db90d
cleanup
marcalff 01c12a6
Merge branch 'main' into merge_config_cmake_build
marcalff 21472c1
Code review comments
marcalff bb5efa3
Restore install_ryml.sh for clang-tidy, iwyu
marcalff b21d192
iwyu and clang-tidy (tentative)
marcalff dba8803
cleanup
marcalff 41025f7
cleanup
marcalff 51fb8f9
fix msvc warnings
marcalff 32e4648
cleanup
marcalff 3469d90
cmake cleanup
marcalff bc2d89d
Merge branch 'main' into merge_config_cmake_build
marcalff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright The OpenTelemetry Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Import the rapidyaml target (ryml::ryml). | ||
# 1. Find an installed ryml package | ||
# 2. Use FetchContent to fetch and build ryml from GitHub | ||
|
||
find_package(ryml QUIET) | ||
set(ryml_PROVIDER "find_package") | ||
|
||
if(NOT ryml_FOUND) | ||
FetchContent_Declare( | ||
"ryml" | ||
GIT_REPOSITORY "https://github.com/biojppm/rapidyaml.git" | ||
GIT_TAG "${ryml_GIT_TAG}" | ||
) | ||
set(ryml_PROVIDER "fetch_repository") | ||
|
||
set(RYML_ENABLE_TESTING OFF CACHE BOOL "" FORCE) | ||
set(RYML_ENABLE_INSTALL OFF CACHE BOOL "" FORCE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the follow up PR with install tests we should also change this to set(RYML_ENABLE_INSTALL ${OPENTELEMETRY_INSTALL} CACHE BOOL "" FORCE) This should allow the install to complete if ryml is fetched. |
||
|
||
FetchContent_MakeAvailable(ryml) | ||
|
||
# Set the ryml_VERSION variable from the git tag. | ||
string(REGEX REPLACE "^v([0-9]+\\.[0-9]+\\.[0-9]+)$" "\\1" ryml_VERSION "${ryml_GIT_TAG}") | ||
endif() | ||
|
||
if(NOT TARGET ryml::ryml) | ||
message(FATAL_ERROR "The required ryml::ryml target was not imported") | ||
endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Copyright The OpenTelemetry Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if(DEFINED OPENTELEMETRY_BUILD_DLL) | ||
add_definitions(-DOPENTELEMETRY_BUILD_IMPORT_DLL) | ||
endif() | ||
|
||
add_executable( | ||
example_yaml | ||
main.cc | ||
custom_sampler.cc | ||
custom_sampler_builder.cc | ||
custom_span_exporter.cc | ||
custom_span_exporter_builder.cc | ||
custom_span_processor.cc | ||
custom_span_processor_builder.cc | ||
custom_push_metric_exporter.cc | ||
custom_push_metric_exporter_builder.cc | ||
custom_pull_metric_exporter.cc | ||
custom_pull_metric_exporter_builder.cc | ||
custom_log_record_exporter.cc | ||
custom_log_record_exporter_builder.cc | ||
custom_log_record_processor.cc | ||
custom_log_record_processor_builder.cc) | ||
|
||
target_link_libraries( | ||
example_yaml ${CMAKE_THREAD_LIBS_INIT} | ||
PRIVATE common_metrics_foo_library | ||
common_logs_foo_library | ||
opentelemetry-cpp::ostream_span_exporter_builder | ||
opentelemetry-cpp::ostream_metrics_exporter_builder | ||
opentelemetry-cpp::ostream_log_record_exporter_builder) | ||
|
||
if(WITH_OTLP_HTTP) | ||
add_definitions(-DOTEL_HAVE_OTLP_HTTP) | ||
target_link_libraries( | ||
example_yaml | ||
PRIVATE opentelemetry-cpp::otlp_http_exporter_builder | ||
opentelemetry-cpp::otlp_http_log_record_exporter_builder | ||
opentelemetry-cpp::otlp_http_metric_exporter_builder) | ||
endif() | ||
|
||
if(WITH_OTLP_GRPC) | ||
add_definitions(-DOTEL_HAVE_OTLP_GRPC) | ||
target_link_libraries( | ||
example_yaml | ||
PRIVATE opentelemetry-cpp::otlp_grpc_exporter_builder | ||
opentelemetry-cpp::otlp_grpc_log_record_exporter_builder | ||
opentelemetry-cpp::otlp_grpc_metrics_exporter_builder) | ||
endif() | ||
|
||
if(WITH_OTLP_FILE) | ||
add_definitions(-DOTEL_HAVE_OTLP_FILE) | ||
target_link_libraries( | ||
example_yaml | ||
PRIVATE opentelemetry-cpp::otlp_file_exporter_builder | ||
opentelemetry-cpp::otlp_file_log_record_exporter_builder | ||
opentelemetry-cpp::otlp_file_metric_exporter_builder) | ||
endif() | ||
|
||
if(WITH_ZIPKIN) | ||
add_definitions(-DOTEL_HAVE_ZIPKIN) | ||
target_link_libraries( | ||
example_yaml PRIVATE opentelemetry-cpp::zipkin_trace_exporter_builder) | ||
endif() | ||
|
||
if(WITH_PROMETHEUS) | ||
add_definitions(-DOTEL_HAVE_PROMETHEUS) | ||
target_link_libraries(example_yaml | ||
PRIVATE opentelemetry-cpp::prometheus_exporter_builder) | ||
endif() | ||
|
||
if(DEFINED OPENTELEMETRY_BUILD_DLL) | ||
target_link_libraries(example_yaml | ||
PRIVATE opentelemetry-cpp::opentelemetry_cpp) | ||
else() | ||
target_link_libraries( | ||
marcalff marked this conversation as resolved.
Show resolved
Hide resolved
|
||
example_yaml | ||
PRIVATE opentelemetry-cpp::configuration opentelemetry-cpp::common | ||
opentelemetry-cpp::trace opentelemetry-cpp::logs) | ||
endif() |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.