early-access version 2853
This commit is contained in:
37
externals/vcpkg/ports/stduuid/fix-gsl-polyfill.patch
vendored
Executable file
37
externals/vcpkg/ports/stduuid/fix-gsl-polyfill.patch
vendored
Executable file
@@ -0,0 +1,37 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index f45a7dc..039ee53 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -37,11 +37,11 @@ if (UUID_TIME_GENERATOR)
|
||||
endif()
|
||||
|
||||
# Using span from std
|
||||
-if (NOT UUID_USING_CXX20_SPAN)
|
||||
- target_include_directories(${PROJECT_NAME} INTERFACE
|
||||
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/gsl>
|
||||
- $<INSTALL_INTERFACE:include/gsl>)
|
||||
- install(DIRECTORY gsl DESTINATION include)
|
||||
+if (UUID_USING_CXX20_SPAN)
|
||||
+ target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_20)
|
||||
+else()
|
||||
+ find_package(Microsoft.GSL CONFIG REQUIRED)
|
||||
+ target_link_libraries(${PROJECT_NAME} INTERFACE Microsoft.GSL::GSL)
|
||||
endif ()
|
||||
|
||||
# Install step and imported target
|
||||
diff --git a/cmake/Config.cmake.in b/cmake/Config.cmake.in
|
||||
index 7217b72..fb981d2 100644
|
||||
--- a/cmake/Config.cmake.in
|
||||
+++ b/cmake/Config.cmake.in
|
||||
@@ -9,6 +9,10 @@ if (@UUID_SYSTEM_GENERATOR@)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
+if (NOT "@UUID_USING_CXX20_SPAN@")
|
||||
+ find_dependency(Microsoft.GSL)
|
||||
+endif ()
|
||||
+
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake")
|
||||
|
||||
check_required_components(@PROJECT_NAME@)
|
||||
\ No newline at end of file
|
||||
23
externals/vcpkg/ports/stduuid/fix-install-directory.patch
vendored
Executable file
23
externals/vcpkg/ports/stduuid/fix-install-directory.patch
vendored
Executable file
@@ -0,0 +1,23 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index fffb92c..f45a7dc 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -11,7 +11,8 @@ option(UUID_USING_CXX20_SPAN "Using span from std instead of gsl" OFF)
|
||||
add_library(${PROJECT_NAME} INTERFACE)
|
||||
target_include_directories(${PROJECT_NAME} INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
- $<INSTALL_INTERFACE:include>)
|
||||
+ $<INSTALL_INTERFACE:include>
|
||||
+ $<INSTALL_INTERFACE:include/stduuid>)
|
||||
|
||||
# Using system uuid generator
|
||||
if (UUID_SYSTEM_GENERATOR)
|
||||
@@ -44,7 +45,7 @@ if (NOT UUID_USING_CXX20_SPAN)
|
||||
endif ()
|
||||
|
||||
# Install step and imported target
|
||||
-install(FILES include/uuid.h DESTINATION include)
|
||||
+install(FILES include/uuid.h DESTINATION include/stduuid)
|
||||
install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}-targets)
|
||||
install(EXPORT ${PROJECT_NAME}-targets
|
||||
DESTINATION lib/cmake/${PROJECT_NAME})
|
||||
32
externals/vcpkg/ports/stduuid/fix-libuuid-dependency.patch
vendored
Executable file
32
externals/vcpkg/ports/stduuid/fix-libuuid-dependency.patch
vendored
Executable file
@@ -0,0 +1,32 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 039ee53..d4218a4 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -23,11 +23,8 @@ if (UUID_SYSTEM_GENERATOR)
|
||||
find_library(CFLIB CoreFoundation REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} INTERFACE ${CFLIB})
|
||||
else ()
|
||||
- find_package(Libuuid REQUIRED)
|
||||
- if (Libuuid_FOUND)
|
||||
- target_include_directories(${PROJECT_NAME} INTERFACE ${Libuuid_INCLUDE_DIRS})
|
||||
- target_link_libraries(${PROJECT_NAME} INTERFACE ${Libuuid_LIBRARIES})
|
||||
- endif ()
|
||||
+ find_package(unofficial-libuuid CONFIG REQUIRED)
|
||||
+ target_link_libraries(${PROJECT_NAME} INTERFACE unofficial::UUID::uuid)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
diff --git a/cmake/Config.cmake.in b/cmake/Config.cmake.in
|
||||
index fb981d2..8a3c8ab 100644
|
||||
--- a/cmake/Config.cmake.in
|
||||
+++ b/cmake/Config.cmake.in
|
||||
@@ -4,8 +4,7 @@ include(CMakeFindDependencyMacro)
|
||||
if (@UUID_SYSTEM_GENERATOR@)
|
||||
if (WIN32 OR APPLE)
|
||||
else ()
|
||||
- list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
|
||||
- find_dependency(Libuuid REQUIRED)
|
||||
+ find_dependency(unofficial-libuuid CONFIG)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
40
externals/vcpkg/ports/stduuid/portfile.cmake
vendored
Executable file
40
externals/vcpkg/ports/stduuid/portfile.cmake
vendored
Executable file
@@ -0,0 +1,40 @@
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO mariusbancila/stduuid
|
||||
REF v1.2.2
|
||||
SHA512 30970c25992e1ba35d96e3b2fc8530466c1070b8b913b8c37e9f698f39121a5a74361e2c4db4c2ba2feddb0ce9b2f14b78c4761cdac09b89a6a0117b179b08a7
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-install-directory.patch
|
||||
fix-gsl-polyfill.patch
|
||||
fix-libuuid-dependency.patch
|
||||
)
|
||||
|
||||
# the debug build is not necessary, because stduuid deployed files are header-only
|
||||
set(VCPKG_BUILD_TYPE release)
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
system-gen UUID_SYSTEM_GENERATOR
|
||||
INVERTED_FEATURES
|
||||
gsl-span UUID_USING_CXX20_SPAN
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(SOURCE_PATH ${SOURCE_PATH}
|
||||
OPTIONS
|
||||
-DUUID_BUILD_TESTS=OFF
|
||||
${FEATURE_OPTIONS}
|
||||
)
|
||||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib)
|
||||
|
||||
if("gsl-span" IN_LIST FEATURES)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/stduuid/uuid.h" "#ifdef __cpp_lib_span" "#if 0")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/stduuid/uuid.h" "#include <span>" "#include <gsl/span>")
|
||||
else()
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/stduuid/uuid.h" "#ifdef __cpp_lib_span" "#if 1")
|
||||
endif()
|
||||
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
33
externals/vcpkg/ports/stduuid/vcpkg.json
vendored
Executable file
33
externals/vcpkg/ports/stduuid/vcpkg.json
vendored
Executable file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "stduuid",
|
||||
"version": "1.2.2",
|
||||
"description": "A C++17 cross-platform implementation for UUIDs",
|
||||
"license": "MIT",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"features": {
|
||||
"gsl-span": {
|
||||
"description": "Using span from gsl instead of std",
|
||||
"dependencies": [
|
||||
"ms-gsl"
|
||||
]
|
||||
},
|
||||
"system-gen": {
|
||||
"description": "Enable operating system uuid generator",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "libuuid",
|
||||
"platform": "!osx & !windows"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user