[correlation-vector-cpp] new port (#37282)

This commit is contained in:
Arthur Araujo 2024-03-19 17:16:27 -03:00 коммит произвёл GitHub
Родитель 7ef729383a
Коммит 5fb67e9da9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
6 изменённых файлов: 116 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,50 @@
diff --git a/CorrelationVector/CMakeLists.txt b/CorrelationVector/CMakeLists.txt
index 2b32f8b..2c3a0ec 100644
--- a/CorrelationVector/CMakeLists.txt
+++ b/CorrelationVector/CMakeLists.txt
@@ -9,7 +9,7 @@ include (CVOptions)
include (CVHelpers)
add_global_definitions ()
-set_global_compile_flags ()
+#set_global_compile_flags ()
set(CORRELATION_VECTOR_VERSION_MAJOR 1)
set(CORRELATION_VECTOR_VERSION_MINOR 0)
diff --git a/CorrelationVector/cmake/correlation_vector-config.in.cmake b/CorrelationVector/cmake/correlation_vector-config.in.cmake
index 6b389d5..9c4fb5a 100644
--- a/CorrelationVector/cmake/correlation_vector-config.in.cmake
+++ b/CorrelationVector/cmake/correlation_vector-config.in.cmake
@@ -1 +1,7 @@
+# Optional dependency for Linux
+if(UNIX)
+ include(CMakeFindDependencyMacro)
+ find_dependency(unofficial-libuuid)
+endif()
+
include("${CMAKE_CURRENT_LIST_DIR}/correlation_vector-targets.cmake")
\ No newline at end of file
diff --git a/CorrelationVector/src/CMakeLists.txt b/CorrelationVector/src/CMakeLists.txt
index 00baa66..08f3fc9 100644
--- a/CorrelationVector/src/CMakeLists.txt
+++ b/CorrelationVector/src/CMakeLists.txt
@@ -15,16 +15,9 @@ else()
if (WIN32)
target_compile_definitions(${TARGETNAME} PUBLIC GUID_WINDOWS)
elseif (UNIX)
- # apt-get install pkg-config uuid-dev
- find_package(PkgConfig REQUIRED)
- # TODO: move to FindUUID module
- pkg_check_modules(UUID uuid)
- if (UUID_FOUND)
- message("Found and using uuid.")
- target_include_directories(${TARGETNAME} PUBLIC ${UUID_INCLUDE_DIRS})
- target_link_libraries(${TARGETNAME} PRIVATE ${UUID_LIBRARIES})
- target_compile_definitions(${TARGETNAME} PUBLIC GUID_LIBUUID)
- endif()
+ find_package(unofficial-libuuid REQUIRED)
+ target_compile_definitions(${TARGETNAME} PUBLIC GUID_LIBUUID)
+ target_link_libraries(${TARGETNAME} PRIVATE unofficial::UUID::uuid)
endif()
endif()

Просмотреть файл

@ -0,0 +1,28 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO microsoft/CorrelationVector-Cpp
REF cf38d2b44baaf352509ad9980786bc49554c32e4
SHA512 f97eaef649ffd010fb79bca0ae6cb7ce6792dcb38f6a5180d04dc6542589d0d727583455bbafb319982cfed1291384180d49c7f32ebe7560b444ec132c76d0c4
HEAD_REF master
PATCHES
"correlation-vector.patch"
)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()
vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}")
vcpkg_cmake_install()
vcpkg_fixup_pkgconfig()
vcpkg_cmake_config_fixup(PACKAGE_NAME correlation_vector CONFIG_PATH lib/correlation_vector)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
if(VCPKG_TARGET_IS_WINDOWS)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()

Просмотреть файл

@ -0,0 +1,4 @@
The package CorrelationVector-Cpp provides CMake targets:
find_package(correlation_vector CONFIG REQUIRED)
target_link_libraries(main PRIVATE microsoft::correlation_vector)

Просмотреть файл

@ -0,0 +1,21 @@
{
"name": "correlation-vector-cpp",
"version": "1.0",
"description": "CorrelationVector-Cpp provides a reference C++ implementation of the CorrelationVector protocol for tracing and correlation of events through a distributed system.",
"homepage": "https://github.com/microsoft/CorrelationVector-Cpp",
"license": "MIT",
"dependencies": [
{
"name": "libuuid",
"platform": "!windows"
},
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

Просмотреть файл

@ -1824,6 +1824,10 @@
"baseline": "2020.06",
"port-version": 8
},
"correlation-vector-cpp": {
"baseline": "1.0",
"port-version": 0
},
"cpp-async": {
"baseline": "1.1.0",
"port-version": 0

Просмотреть файл

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "004b3aeae78d35b82ed9672a0d94340a82bfdc06",
"version": "1.0",
"port-version": 0
}
]
}