-
Notifications
You must be signed in to change notification settings - Fork 438
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
[BUILD] DLL export interface for Metrics #2344
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b94d6ba
Export Metrics classes from SDK
perhapsmaple d25ca58
Export OTLP Metric Exporters
perhapsmaple a177289
Update Exported Symbols
perhapsmaple 606aebb
Build Metrics into DLL
perhapsmaple 80aaa15
Merge branch 'open-telemetry:main' into Metrics_DLL
perhapsmaple d7c51ef
Fix formatting
perhapsmaple 799461f
Merge branch 'main' into Metrics_DLL
marcalff 3399256
Merge branch 'main' into Metrics_DLL
marcalff 397e565
Merge branch 'main' into Metrics_DLL
ThomsonTan 26b2207
Fix CMakeLists
perhapsmaple b1c4448
Add Metrics and Logs Tests to CI
perhapsmaple 96b1361
Merge branch 'main' into Metrics_DLL
perhapsmaple 4a08f95
Merge branch 'main' into Metrics_DLL
esigo 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 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 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 |
---|---|---|
@@ -1,6 +1,12 @@ | ||
# Copyright The OpenTelemetry Authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if(DEFINED OPENTELEMETRY_BUILD_DLL) | ||
add_definitions(-DOPENTELEMETRY_BUILD_IMPORT_DLL) | ||
endif() | ||
|
||
add_library(common_metrics_foo_library foo_library.h foo_library.cc) | ||
set_target_version(common_metrics_foo_library) | ||
target_link_libraries(common_metrics_foo_library PUBLIC opentelemetry_api) | ||
|
||
target_link_libraries(common_metrics_foo_library | ||
PUBLIC ${CMAKE_THREAD_LIBS_INIT} opentelemetry_api) |
This file contains 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 |
---|---|---|
@@ -1,9 +1,20 @@ | ||
# 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}/exporters/ostream/include) | ||
|
||
add_executable(metrics_ostream_example metrics_ostream.cc) | ||
target_link_libraries( | ||
metrics_ostream_example ${CMAKE_THREAD_LIBS_INIT} opentelemetry_metrics | ||
opentelemetry_exporter_ostream_metrics opentelemetry_resources | ||
common_metrics_foo_library) | ||
target_link_libraries(metrics_ostream_example ${CMAKE_THREAD_LIBS_INIT} | ||
common_metrics_foo_library) | ||
|
||
if(DEFINED OPENTELEMETRY_BUILD_DLL) | ||
target_link_libraries(metrics_ostream_example opentelemetry_cpp) | ||
else() | ||
target_link_libraries( | ||
metrics_ostream_example opentelemetry_metrics | ||
opentelemetry_exporter_ostream_metrics opentelemetry_resources) | ||
endif() |
This file contains 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 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 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 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 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 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 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 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 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 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 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a problem of this PR, but I think we should use
if(OPENTELEMETRY_BUILD_DLL)
instead ofif(DEFINED OPENTELEMETRY_BUILD_DLL)
. And usetarget_compile_definitions(opentelemetry_api INTERFACE OPENTELEMETRY_BUILD_IMPORT_DLL)
instead ofadd_definitions(-DOPENTELEMETRY_BUILD_IMPORT_DLL)
, so we can exporting this definition to cmake package.