Skip to content

Commit

Permalink
cmake: remove git fetch and use submodule for building opentelemetry lib
Browse files Browse the repository at this point in the history
We were using git fetch and an unofficial remote to fetch
opentelemetry-cpp, as it needed additional patch to include boost
headers, with the merge of

open-telemetry/opentelemetry-cpp#1100
open-telemetry/opentelemetry-cpp#1020

we do not require to maintain our own patched version. Also, we were
using git fetch as a temporary change, now that tracing is always on, it
should be right time to adapt to using opentelemetry-cpp as a submodule.

This removes compile time fetch for opentelemetry-cpp instead use
official opentelemetry-cpp lib as a submodule.

Signed-off-by: Deepika Upadhyay <[email protected]>
  • Loading branch information
Deepika Upadhyay committed Jun 22, 2022
1 parent 2c15a80 commit 3eb6c29
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions cmake/modules/BuildOpentelemetry.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function(target_create _target _lib)
endfunction()

function(build_opentelemetry)
set(opentelemetry_SOURCE_DIR "${PROJECT_SOURCE_DIR}/src/opentelemetry-cpp")
set(opentelemetry_SOURCE_DIR "${PROJECT_SOURCE_DIR}/src/jaegertracing/opentelemetry-cpp")
set(opentelemetry_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/opentelemetry-cpp")
set(opentelemetry_cpp_targets opentelemetry_trace opentelemetry_exporter_jaeger_trace)
set(opentelemetry_CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON
Expand All @@ -20,7 +20,7 @@ function(build_opentelemetry)
${opentelemetry_BINARY_DIR}/sdk/src/resource/libopentelemetry_resources.a
${opentelemetry_BINARY_DIR}/sdk/src/common/libopentelemetry_common.a
${opentelemetry_BINARY_DIR}/exporters/jaeger/libopentelemetry_exporter_jaeger_trace.a
${opentelemetry_BINARY_DIR}/ext/src/http/client/curl/libhttp_client_curl.a
${opentelemetry_BINARY_DIR}/ext/src/http/client/curl/libopentelemetry_http_client_curl.a
${CURL_LIBRARIES}
)
set(opentelemetry_include_dir ${opentelemetry_SOURCE_DIR}/api/include/
Expand Down Expand Up @@ -48,11 +48,7 @@ function(build_opentelemetry)
endif()

include(ExternalProject)
ExternalProject_Add(
opentelemetry-cpp
GIT_REPOSITORY https://github.com/ideepika/opentelemetry-cpp.git
GIT_TAG wip-ceph
GIT_SHALLOW 1
ExternalProject_Add(opentelemetry-cpp
SOURCE_DIR ${opentelemetry_SOURCE_DIR}
PREFIX "opentelemetry-cpp"
CMAKE_ARGS ${opentelemetry_CMAKE_ARGS}
Expand All @@ -74,7 +70,7 @@ function(build_opentelemetry)
target_create("opentelemetry_exporter_jaeger_trace"
"exporters/jaeger/libopentelemetry_exporter_jaeger_trace.a")
target_create("http_client_curl"
"ext/src/http/client/curl/libhttp_client_curl.a")
"ext/src/http/client/curl/libopentelemetry_http_client_curl.a")

# will do all linking and path setting fake include path for
# interface_include_directories since this happens at build time
Expand Down

0 comments on commit 3eb6c29

Please sign in to comment.