[opencensus-cpp] Update to 2021-08-26 (#21894)

* [opencensus-cpp] Update to 2021-08-26

Signed-off-by: Daniel Lundborg <daniel.lundborg@sandvik.com>

* Update ports/opencensus-cpp/vcpkg.json

Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com>

* [opencensus-cpp] use baseline port-version 0

Signed-off-by: Daniel Lundborg <daniel.lundborg@sandvik.com>

* [opencensus-cpp] replace deprecated vcpkg functions

Signed-off-by: Daniel Lundborg <daniel.lundborg@sandvik.com>

Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com>
This commit is contained in:
Daniel Lundborg 2021-12-08 22:57:40 +01:00 committed by GitHub
parent 3496b4a3a9
commit 501df2f7e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 146 additions and 86 deletions

View File

@ -1,12 +1,12 @@
diff --git a/cmake/OpenCensusHelpers.cmake b/cmake/OpenCensusHelpers.cmake
index c8d35e6..a15231a 100644
index 8fdfe96..53bc877 100644
--- a/cmake/OpenCensusHelpers.cmake
+++ b/cmake/OpenCensusHelpers.cmake
@@ -38,6 +38,13 @@ function(opencensus_test NAME SRC)
gmock
gtest_main)
@@ -37,6 +37,13 @@ function(opencensus_test NAME SRC)
prepend_opencensus(DEPS "${ARGN}")
target_link_libraries(${_NAME} "${DEPS}" gmock gtest_main)
add_test(NAME ${_NAME} COMMAND ${_NAME})
+
+
+ install(
+ TARGETS ${_NAME}
+ RUNTIME DESTINATION tools
@ -16,11 +16,11 @@ index c8d35e6..a15231a 100644
endif()
endfunction()
@@ -51,6 +58,13 @@ function(opencensus_benchmark NAME SRC)
@@ -50,6 +57,13 @@ function(opencensus_benchmark NAME SRC)
add_executable(${_NAME} ${SRC})
prepend_opencensus(DEPS "${ARGN}")
target_link_libraries(${_NAME} "${DEPS}" benchmark)
+
+
+ install(
+ TARGETS ${_NAME}
+ RUNTIME DESTINATION tools
@ -30,11 +30,10 @@ index c8d35e6..a15231a 100644
endif()
endfunction()
@@ -76,6 +90,13 @@ function(opencensus_lib NAME)
@@ -71,6 +85,12 @@ function(opencensus_lib NAME)
if(ARG_PUBLIC)
add_library(${PROJECT_NAME}::${NAME} ALIAS ${_NAME})
endif()
+
+ install(
+ TARGETS ${_NAME}
+ RUNTIME DESTINATION bin
@ -44,11 +43,11 @@ index c8d35e6..a15231a 100644
endfunction()
# Helper function for fuzzing. Usage:
@@ -88,5 +109,12 @@ function(opencensus_fuzzer NAME SRC)
@@ -83,5 +103,12 @@ function(opencensus_fuzzer NAME SRC)
prepend_opencensus(DEPS "${ARGN}")
target_link_libraries(${_NAME} "${DEPS}" ${FUZZER})
target_compile_options(${_NAME} PRIVATE ${FUZZER})
+
+
+ install(
+ TARGETS ${_NAME}
+ RUNTIME DESTINATION tools
@ -58,97 +57,148 @@ index c8d35e6..a15231a 100644
endif()
endfunction()
diff --git a/examples/helloworld/CMakeLists.txt b/examples/helloworld/CMakeLists.txt
index 456169f..71e43d1 100644
index 86cc1f4..cbbcb29 100644
--- a/examples/helloworld/CMakeLists.txt
+++ b/examples/helloworld/CMakeLists.txt
@@ -22,3 +22,10 @@ target_link_libraries(opencensus_examples_helloworld
opencensus-cpp::stats
opencensus-cpp::trace
Threads::Threads)
@@ -23,3 +23,10 @@ target_link_libraries(
opencensus-cpp::stats
opencensus-cpp::trace
Threads::Threads)
+
+install(
+ TARGETS opencensus_examples_helloworld
+ RUNTIME DESTINATION tools
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+ TARGETS opencensus_examples_helloworld
+ RUNTIME DESTINATION tools
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+)
\ No newline at end of file
diff --git a/opencensus/common/internal/CMakeLists.txt b/opencensus/common/internal/CMakeLists.txt
index c18859d..55a1121 100644
index a9dbd87..810a8c8 100644
--- a/opencensus/common/internal/CMakeLists.txt
+++ b/opencensus/common/internal/CMakeLists.txt
@@ -21,6 +21,8 @@ opencensus_lib(common_random
absl::base
absl::synchronization
absl::time)
+
+install(FILES ${CMAKE_CURRENT_LIST_DIR}/../version.h DESTINATION include/opencensus-cpp/common/internal)
@@ -23,6 +23,12 @@ opencensus_lib(
absl::synchronization
absl::time)
+file(GLOB HDRS ${CMAKE_CURRENT_LIST_DIR}/*.h)
+install(FILES ${HDRS} DESTINATION include/opencensus-cpp/opencensus/common/internal)
+
+file(GLOB HDRS ${CMAKE_CURRENT_LIST_DIR}/grpc/*.h)
+install(FILES ${HDRS} DESTINATION include/opencensus-cpp/opencensus/common/internal/grpc)
+
opencensus_lib(common_stats_object DEPS absl::time)
# Define NOMINMAX to fix build errors when compiling with MSVC.
diff --git a/opencensus/context/CMakeLists.txt b/opencensus/context/CMakeLists.txt
index 525885b..537de02 100644
index 149958c..2474a66 100644
--- a/opencensus/context/CMakeLists.txt
+++ b/opencensus/context/CMakeLists.txt
@@ -21,6 +21,10 @@ opencensus_lib(context
tags
trace)
@@ -22,6 +22,9 @@ opencensus_lib(
tags
trace)
+install(FILES ${CMAKE_CURRENT_LIST_DIR}/context.h
+ ${CMAKE_CURRENT_LIST_DIR}/with_context.h
+ DESTINATION include/opencensus-cpp/context)
+file(GLOB HDRS ${CMAKE_CURRENT_LIST_DIR}/*.h)
+install(FILES ${HDRS} DESTINATION include/opencensus-cpp/opencensus/context)
+
opencensus_test(context_context_test
internal/context_test.cc
context
opencensus_test(
context_context_test
internal/context_test.cc
diff --git a/opencensus/exporters/stats/prometheus/CMakeLists.txt b/opencensus/exporters/stats/prometheus/CMakeLists.txt
index 4da7de7..39121f5 100644
index 01038cc..0ad712b 100644
--- a/opencensus/exporters/stats/prometheus/CMakeLists.txt
+++ b/opencensus/exporters/stats/prometheus/CMakeLists.txt
@@ -28,6 +28,8 @@ opencensus_lib(exporters_stats_prometheus_utils
absl::strings
absl::time
prometheus-cpp::core)
+
+install(FILES ${CMAKE_CURRENT_LIST_DIR}/prometheus_exporter.h DESTINATION include/opencensus-cpp/exporters/stats/prometheus)
@@ -21,6 +21,12 @@ opencensus_lib(
exporters_stats_prometheus_utils
stats)
opencensus_test(exporters_stats_prometheus_utils_test
internal/prometheus_utils_test.cc
+file(GLOB HDRS ${CMAKE_CURRENT_LIST_DIR}/*.h)
+install(FILES ${HDRS} DESTINATION include/opencensus-cpp/opencensus/exporters/stats/prometheus)
+
+file(GLOB HDRS ${CMAKE_CURRENT_LIST_DIR}/internal/*.h)
+install(FILES ${HDRS} DESTINATION include/opencensus-cpp/opencensus/exporters/stats/prometheus/internal)
+
opencensus_lib(
exporters_stats_prometheus_utils
SRCS
diff --git a/opencensus/exporters/stats/stdout/CMakeLists.txt b/opencensus/exporters/stats/stdout/CMakeLists.txt
index b4f3110..31bc991 100644
index 5278e65..2930817 100644
--- a/opencensus/exporters/stats/stdout/CMakeLists.txt
+++ b/opencensus/exporters/stats/stdout/CMakeLists.txt
@@ -21,6 +21,8 @@ opencensus_lib(exporters_stats_stdout
absl::memory
absl::strings
absl::time)
+
+install(FILES ${CMAKE_CURRENT_LIST_DIR}/stdout_exporter.h DESTINATION include/opencensus-cpp/exporters/stats/stdout)
@@ -23,5 +23,8 @@ opencensus_lib(
absl::strings
absl::time)
opencensus_test(exporters_stats_stdout_test
internal/stdout_exporter_test.cc
+file(GLOB HDRS ${CMAKE_CURRENT_LIST_DIR}/*.h)
+install(FILES ${HDRS} DESTINATION include/opencensus-cpp/opencensus/exporters/stats/stdout)
+
opencensus_test(exporters_stats_stdout_test internal/stdout_exporter_test.cc
exporters_stats_stdout stats stats_test_utils absl::time)
diff --git a/opencensus/exporters/trace/stdout/CMakeLists.txt b/opencensus/exporters/trace/stdout/CMakeLists.txt
index 2b8bc78..fce50e7 100644
index c7c580f..d9befa1 100644
--- a/opencensus/exporters/trace/stdout/CMakeLists.txt
+++ b/opencensus/exporters/trace/stdout/CMakeLists.txt
@@ -21,6 +21,7 @@ opencensus_lib(exporters_trace_stdout
absl::base
absl::memory)
@@ -22,5 +22,8 @@ opencensus_lib(
absl::base
absl::memory)
+install(FILES ${CMAKE_CURRENT_LIST_DIR}/stdout_exporter.h DESTINATION include/opencensus-cpp/exporters/trace/stdout)
opencensus_test(exporters_trace_stdout_test
internal/stdout_exporter_test.cc
exporters_trace_stdout
+file(GLOB HDRS ${CMAKE_CURRENT_LIST_DIR}/*.h)
+install(FILES ${HDRS} DESTINATION include/opencensus-cpp/opencensus/exporters/trace/stdout)
+
opencensus_test(exporters_trace_stdout_test internal/stdout_exporter_test.cc
exporters_trace_stdout trace absl::time)
diff --git a/opencensus/stats/CMakeLists.txt b/opencensus/stats/CMakeLists.txt
index 9b0d7af..a8a9d50 100644
--- a/opencensus/stats/CMakeLists.txt
+++ b/opencensus/stats/CMakeLists.txt
@@ -71,6 +71,12 @@ opencensus_lib(
absl::strings
absl::time)
+file(GLOB HDRS ${CMAKE_CURRENT_LIST_DIR}/*.h)
+install(FILES ${HDRS} DESTINATION include/opencensus-cpp/opencensus/stats)
+
+file(GLOB HDRS ${CMAKE_CURRENT_LIST_DIR}/internal/*.h)
+install(FILES ${HDRS} DESTINATION include/opencensus-cpp/opencensus/stats/internal)
+
# ----------------------------------------------------------------------
# Tests
# ----------------------------------------------------------------------
diff --git a/opencensus/tags/CMakeLists.txt b/opencensus/tags/CMakeLists.txt
index dbc4c9b..1b304ce 100644
index 7219a2a..97a0de1 100644
--- a/opencensus/tags/CMakeLists.txt
+++ b/opencensus/tags/CMakeLists.txt
@@ -40,6 +40,8 @@ opencensus_lib(tags_with_tag_map
context
absl::strings)
@@ -53,6 +53,12 @@ opencensus_lib(
context
absl::strings)
+file(GLOB TAGS_HDRS ${CMAKE_CURRENT_LIST_DIR}/*.h)
+install(FILES ${TAGS_HDRS} DESTINATION include/opencensus-cpp/tags)
opencensus_test(tags_context_util_test
internal/context_util_test.cc
tags
+file(GLOB HDRS ${CMAKE_CURRENT_LIST_DIR}/*.h)
+install(FILES ${HDRS} DESTINATION include/opencensus-cpp/opencensus/tags)
+
+file(GLOB HDRS ${CMAKE_CURRENT_LIST_DIR}/propagation/*.h)
+install(FILES ${HDRS} DESTINATION include/opencensus-cpp/opencensus/tags/propagation)
+
opencensus_test(tags_context_util_test internal/context_util_test.cc tags
tags_context_util tags_with_tag_map context)
diff --git a/opencensus/trace/CMakeLists.txt b/opencensus/trace/CMakeLists.txt
index 2c4e656..25d7241 100644
--- a/opencensus/trace/CMakeLists.txt
+++ b/opencensus/trace/CMakeLists.txt
@@ -122,6 +122,18 @@ opencensus_lib(
trace
context)
+file(GLOB HDRS ${CMAKE_CURRENT_LIST_DIR}/*.h)
+install(FILES ${HDRS} DESTINATION include/opencensus-cpp/opencensus/trace)
+
+file(GLOB HDRS ${CMAKE_CURRENT_LIST_DIR}/exporter/*.h)
+install(FILES ${HDRS} DESTINATION include/opencensus-cpp/opencensus/trace/exporter)
+
+file(GLOB HDRS ${CMAKE_CURRENT_LIST_DIR}/internal/*.h)
+install(FILES ${HDRS} DESTINATION include/opencensus-cpp/opencensus/trace/internal)
+
+file(GLOB HDRS ${CMAKE_CURRENT_LIST_DIR}/propagation/*.h)
+install(FILES ${HDRS} DESTINATION include/opencensus-cpp/opencensus/trace/propagation)
+
# ----------------------------------------------------------------------
# Tests
# ----------------------------------------------------------------------

View File

@ -1,25 +1,23 @@
vcpkg_fail_port_install(ON_TARGET "Windows")
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO census-instrumentation/opencensus-cpp
REF 2b0725c2d0f809351300c634c54e70e0a8c3f4ed #v0.4.0
SHA512 16f3975ed0580aec83e0dd98f15a04d614cf45bfa7e07b0b94e881afc12e8e4bac3c0efde1f8e7da9f5dc66365415ae1e3ab10dfcbd9e078879246db6e81cd56
REF 62d8281899a1cfd1084793f64295329a6b5d22b3 # 2021-08-26
SHA512 35df40d7e5ce933384fe6ba4ac2d704e0801ac47765fca97ea3f8d787886abe5c588855c3aac5745f047c1c8f2047e1f69b62340dd702042a61c3dc430ca36b4
HEAD_REF master
PATCHES fix-install.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
test BUILD_TESTING
FEATURES
test BUILD_TESTING
)
vcpkg_configure_cmake(
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS ${FEATURE_OPTIONS}
)
vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_copy_pdbs()

View File

@ -1,12 +1,19 @@
{
"name": "opencensus-cpp",
"version-string": "0.4.0",
"port-version": 2,
"version-date": "2021-08-26",
"description": "OpenCensus is a toolkit for collecting application performance and behavior data. It currently includes an API for tracing and stats.",
"homepage": "https://github.com/census-instrumentation/opencensus-cpp",
"supports": "!windows",
"dependencies": [
"abseil"
"abseil",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"test": {

View File

@ -4917,8 +4917,8 @@
"port-version": 9
},
"opencensus-cpp": {
"baseline": "0.4.0",
"port-version": 2
"baseline": "2021-08-26",
"port-version": 0
},
"opencl": {
"baseline": "2.2",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1e0e908de8a31c22d295c1ad069e87ab2eb964b7",
"version-date": "2021-08-26",
"port-version": 0
},
{
"git-tree": "cd8e1133cda88028a939ad52bd047894959fc9fd",
"version-string": "0.4.0",