2021-08-19 08:14:57 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO open-telemetry/opentelemetry-cpp
|
2023-02-08 07:31:57 +08:00
|
|
|
REF "v${VERSION}"
|
2023-03-16 01:28:02 +08:00
|
|
|
SHA512 eb7dde38134fd9f51f22a2288a3a1db9eeec3dce3889c02fea82e20738a697449be73d632c3d1889ff159f0274d57bfd066db506149b221fe6ced8f18fdc1237
|
2021-08-19 08:14:57 +08:00
|
|
|
HEAD_REF main
|
2022-10-15 08:52:31 +08:00
|
|
|
PATCHES
|
2023-04-11 03:50:22 +08:00
|
|
|
# Use the compiler's default C++ version. Picking a version with
|
|
|
|
# CMAKE_CXX_STANDARD is not needed as the Abseil port already picked
|
|
|
|
# one and propagates that version across all its downstream deps.
|
|
|
|
use-default-cxx-version.patch
|
|
|
|
# When compiling code generated by gRPC we need to link the gRPC library
|
|
|
|
# too.
|
|
|
|
add-missing-dependencies.patch
|
|
|
|
# Missing find_dependency for Abseil
|
|
|
|
add-missing-find-dependency.patch
|
2021-08-19 08:14:57 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
|
|
|
etw WITH_ETW
|
|
|
|
zipkin WITH_ZIPKIN
|
|
|
|
prometheus WITH_PROMETHEUS
|
|
|
|
elasticsearch WITH_ELASTICSEARCH
|
|
|
|
jaeger WITH_JAEGER
|
2021-11-06 04:00:50 +08:00
|
|
|
otlp WITH_OTLP
|
2023-02-08 07:31:57 +08:00
|
|
|
otlp-http WITH_OTLP_HTTP
|
2021-11-06 04:00:50 +08:00
|
|
|
zpages WITH_ZPAGES
|
2023-04-14 05:58:46 +08:00
|
|
|
otlp-grpc WITH_OTLP_GRPC
|
2021-08-19 08:14:57 +08:00
|
|
|
)
|
|
|
|
|
2021-11-06 04:00:50 +08:00
|
|
|
# opentelemetry-proto is a third party submodule and opentelemetry-cpp release did not pack it.
|
|
|
|
if(WITH_OTLP)
|
2022-11-03 02:53:15 +08:00
|
|
|
set(OTEL_PROTO_VERSION "0.19.0")
|
2021-11-06 04:00:50 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
|
|
|
URLS "https://github.com/open-telemetry/opentelemetry-proto/archive/v${OTEL_PROTO_VERSION}.tar.gz"
|
|
|
|
FILENAME "opentelemetry-proto-${OTEL_PROTO_VERSION}.tar.gz"
|
2022-11-03 02:53:15 +08:00
|
|
|
SHA512 b6d47aaa90ff934eb24047757d5fdb8a5be62963a49b632460511155f09a725937fb7535cf34f738b81cc799600adbbc3809442aba584d760891c0a1f0ce8c03
|
2021-11-06 04:00:50 +08:00
|
|
|
)
|
|
|
|
|
2022-10-15 08:52:31 +08:00
|
|
|
vcpkg_extract_source_archive(src ARCHIVE "${ARCHIVE}")
|
2022-09-27 02:35:51 +08:00
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/third_party/opentelemetry-proto")
|
2022-10-15 08:52:31 +08:00
|
|
|
file(COPY "${src}/." DESTINATION "${SOURCE_PATH}/third_party/opentelemetry-proto")
|
|
|
|
# Create empty .git directory to prevent opentelemetry from cloning it during build time
|
|
|
|
file(MAKE_DIRECTORY "${SOURCE_PATH}/third_party/opentelemetry-proto/.git")
|
2023-03-29 04:35:06 +08:00
|
|
|
list(APPEND FEATURE_OPTIONS -DCMAKE_CXX_STANDARD=14)
|
2023-04-05 06:23:02 +08:00
|
|
|
list(APPEND FEATURE_OPTIONS -DgRPC_CPP_PLUGIN_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/grpc/grpc_cpp_plugin${VCPKG_HOST_EXECUTABLE_SUFFIX})
|
2021-11-06 04:00:50 +08:00
|
|
|
endif()
|
|
|
|
|
2021-08-19 08:14:57 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
OPTIONS
|
|
|
|
-DBUILD_TESTING=OFF
|
|
|
|
-DWITH_EXAMPLES=OFF
|
2022-07-23 04:52:15 +08:00
|
|
|
-DWITH_LOGS_PREVIEW=ON
|
2023-03-16 01:28:02 +08:00
|
|
|
-DOPENTELEMETRY_INSTALL=ON
|
2023-04-11 03:50:22 +08:00
|
|
|
-DWITH_ABSEIL=ON
|
2021-08-19 08:14:57 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2023-04-14 05:58:46 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
WITH_OTLP_GRPC
|
2021-08-19 08:14:57 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_cmake_install()
|
2022-10-15 08:52:31 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
|
2021-08-19 08:14:57 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2023-04-14 05:58:46 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|