-
Notifications
You must be signed in to change notification settings - Fork 440
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
Extract foo library into a separate library #1043
Merged
lalitb
merged 4 commits into
open-telemetry:main
from
esigo:Extract-foo_library-into-a-separate-library
Oct 30, 2021
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
add_subdirectory(foo_library) |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
cc_library( | ||
name = "common_foo_library", | ||
srcs = [ | ||
"foo_library.cc", | ||
], | ||
hdrs = [ | ||
"foo_library.h", | ||
], | ||
defines = ["BAZEL_BUILD"], | ||
deps = [ | ||
"//api", | ||
"//sdk:headers", | ||
], | ||
) |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
add_library(common_foo_library foo_library.h foo_library.cc) | ||
target_link_libraries(common_foo_library PUBLIC ${CMAKE_THREAD_LIBS_INIT} | ||
opentelemetry_api) |
File renamed without changes.
File renamed without changes.
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,10 +1,6 @@ | ||
include_directories(${CMAKE_SOURCE_DIR}/exporters/jaeger/include) | ||
|
||
add_library(jaeger_foo_library foo_library/foo_library.cc) | ||
target_link_libraries(jaeger_foo_library ${CMAKE_THREAD_LIBS_INIT} | ||
opentelemetry_api) | ||
|
||
add_executable(example_jaeger main.cc) | ||
target_link_libraries( | ||
example_jaeger ${CMAKE_THREAD_LIBS_INIT} jaeger_foo_library | ||
example_jaeger ${CMAKE_THREAD_LIBS_INIT} common_foo_library | ||
opentelemetry_trace opentelemetry_exporter_jaeger_trace) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
include_directories(${CMAKE_SOURCE_DIR}/exporters/ostream/include | ||
${CMAKE_SOURCE_DIR}/exporters/memory/include) | ||
|
||
add_library(foo_multi_library foo_library/foo_library.cc) | ||
target_link_libraries(foo_multi_library opentelemetry_exporter_ostream_span | ||
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api) | ||
|
||
add_executable(example_multi_processor main.cc) | ||
target_link_libraries(example_multi_processor ${CMAKE_THREAD_LIBS_INIT} | ||
foo_multi_library opentelemetry_trace) | ||
target_link_libraries( | ||
example_multi_processor ${CMAKE_THREAD_LIBS_INIT} common_foo_library | ||
opentelemetry_trace opentelemetry_exporter_ostream_span) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
include_directories( | ||
${CMAKE_BINARY_DIR}/generated/third_party/opentelemetry-proto) | ||
include_directories(${CMAKE_SOURCE_DIR}/exporters/otlp/include) | ||
|
||
add_library(otlp_foo_library foo_library/foo_library.cc) | ||
target_link_libraries(otlp_foo_library ${CMAKE_THREAD_LIBS_INIT} | ||
opentelemetry_api) | ||
${CMAKE_BINARY_DIR}/generated/third_party/opentelemetry-proto | ||
${CMAKE_SOURCE_DIR}/exporters/otlp/include) | ||
|
||
if(WITH_OTLP_GRPC) | ||
add_executable(example_otlp_grpc grpc_main.cc) | ||
target_link_libraries( | ||
example_otlp_grpc ${CMAKE_THREAD_LIBS_INIT} otlp_foo_library | ||
example_otlp_grpc ${CMAKE_THREAD_LIBS_INIT} common_foo_library | ||
opentelemetry_trace opentelemetry_exporter_otlp_grpc gRPC::grpc++) | ||
endif() | ||
|
||
if(WITH_OTLP_HTTP) | ||
add_executable(example_otlp_http http_main.cc) | ||
target_link_libraries( | ||
example_otlp_http ${CMAKE_THREAD_LIBS_INIT} otlp_foo_library | ||
example_otlp_http ${CMAKE_THREAD_LIBS_INIT} common_foo_library | ||
opentelemetry_trace opentelemetry_exporter_otlp_http) | ||
endif() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,11 @@ | ||
cc_library( | ||
name = "foo_library", | ||
srcs = [ | ||
"foo_library/foo_library.cc", | ||
], | ||
hdrs = [ | ||
"foo_library/foo_library.h", | ||
], | ||
deps = [ | ||
"//api", | ||
], | ||
) | ||
|
||
cc_binary( | ||
name = "example_simple", | ||
srcs = [ | ||
"main.cc", | ||
], | ||
deps = [ | ||
":foo_library", | ||
"//api", | ||
"//examples/common/foo_library:common_foo_library", | ||
"//exporters/ostream:ostream_span_exporter", | ||
"//sdk/src/trace", | ||
], | ||
) |
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,6 @@ | ||
include_directories(${CMAKE_SOURCE_DIR}/exporters/ostream/include) | ||
|
||
add_library(foo_library foo_library/foo_library.cc) | ||
target_link_libraries(foo_library opentelemetry_exporter_ostream_span | ||
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api) | ||
|
||
add_executable(example_simple main.cc) | ||
target_link_libraries(example_simple ${CMAKE_THREAD_LIBS_INIT} foo_library | ||
opentelemetry_trace) | ||
target_link_libraries( | ||
example_simple ${CMAKE_THREAD_LIBS_INIT} common_foo_library | ||
opentelemetry_trace opentelemetry_exporter_ostream_span) |
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.
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.
Nit: we can also add
include_directories(common)
here, and remove the dependency from subfolders ?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.
good one, thanks