-
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 2 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
Some comments aren't visible on the classic Files Changed page.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
# Copyright The OpenTelemetry Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -ex | ||
marcalff marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
export DEBIAN_FRONTEND=noninteractive | ||
[ -z "${RYML_VERSION}" ] && export RYML_VERSION="v0.9.0" | ||
|
||
BUILD_DIR=/tmp/ | ||
INSTALL_DIR=/usr/local/ | ||
pushd $BUILD_DIR | ||
git clone --recursive -b ${RYML_VERSION} https://github.com/biojppm/rapidyaml.git | ||
|
||
cd rapidyaml | ||
RYML_BUILD_OPTIONS=( | ||
"-DBUILD_TESTING=OFF" | ||
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON" | ||
"-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR" | ||
) | ||
|
||
if [ ! -z "${CXX_STANDARD}" ]; then | ||
RYML_BUILD_OPTIONS=(${RYML_BUILD_OPTIONS[@]} "-DCMAKE_CXX_STANDARD=${CXX_STANDARD}") | ||
fi | ||
|
||
mkdir build && pushd build | ||
cmake "${RYML_BUILD_OPTIONS[@]}" .. | ||
make -j $(nproc) | ||
make install | ||
popd | ||
popd | ||
export PATH=${INSTALL_DIR}/bin:$PATH # ensure to use the installed ryml |
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,86 @@ | ||
# Copyright The OpenTelemetry Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if(DEFINED OPENTELEMETRY_BUILD_DLL) | ||
add_definitions(-DOPENTELEMETRY_BUILD_IMPORT_DLL) | ||
endif() | ||
|
||
include_directories(${CMAKE_SOURCE_DIR}/sdk/include) | ||
|
||
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} | ||
common_metrics_foo_library | ||
common_logs_foo_library | ||
opentelemetry_exporter_ostream_span_builder | ||
opentelemetry_exporter_ostream_metrics_builder | ||
opentelemetry_exporter_ostream_logs_builder) | ||
|
||
if(WITH_OTLP_HTTP) | ||
include_directories(${CMAKE_SOURCE_DIR}/exporters/otlp/include) | ||
marcalff marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
add_definitions(-DOTEL_HAVE_OTLP_HTTP) | ||
target_link_libraries(example_yaml opentelemetry_exporter_otlp_http_builder) | ||
target_link_libraries(example_yaml | ||
marcalff marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
opentelemetry_exporter_otlp_http_log_builder) | ||
target_link_libraries(example_yaml | ||
opentelemetry_exporter_otlp_http_metric_builder) | ||
endif() | ||
|
||
if(WITH_OTLP_GRPC) | ||
include_directories(${CMAKE_SOURCE_DIR}/exporters/otlp/include) | ||
add_definitions(-DOTEL_HAVE_OTLP_GRPC) | ||
target_link_libraries(example_yaml opentelemetry_exporter_otlp_grpc_builder) | ||
target_link_libraries(example_yaml | ||
opentelemetry_exporter_otlp_grpc_log_builder) | ||
target_link_libraries(example_yaml | ||
opentelemetry_exporter_otlp_grpc_metrics_builder) | ||
endif() | ||
|
||
if(WITH_OTLP_FILE) | ||
include_directories(${CMAKE_SOURCE_DIR}/exporters/otlp/include) | ||
add_definitions(-DOTEL_HAVE_OTLP_FILE) | ||
target_link_libraries(example_yaml opentelemetry_exporter_otlp_file_builder) | ||
target_link_libraries(example_yaml | ||
opentelemetry_exporter_otlp_file_log_builder) | ||
target_link_libraries(example_yaml | ||
opentelemetry_exporter_otlp_file_metric_builder) | ||
endif() | ||
|
||
if(WITH_ZIPKIN) | ||
include_directories(${CMAKE_SOURCE_DIR}/exporters/zipkin/include) | ||
add_definitions(-DOTEL_HAVE_ZIPKIN) | ||
target_link_libraries(example_yaml | ||
opentelemetry_exporter_zipkin_trace_builder) | ||
endif() | ||
|
||
if(WITH_PROMETHEUS) | ||
include_directories(${CMAKE_SOURCE_DIR}/exporters/prometheus/include) | ||
add_definitions(-DOTEL_HAVE_PROMETHEUS) | ||
target_link_libraries(example_yaml opentelemetry_exporter_prometheus_builder) | ||
endif() | ||
|
||
if(DEFINED OPENTELEMETRY_BUILD_DLL) | ||
target_link_libraries(example_yaml opentelemetry_cpp) | ||
else() | ||
target_link_libraries( | ||
marcalff marked this conversation as resolved.
Show resolved
Hide resolved
|
||
example_yaml opentelemetry_configuration opentelemetry_common | ||
opentelemetry_trace opentelemetry_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.