aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/azure-core-cpp
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/azure-core-cpp')
-rw-r--r--vcpkg/ports/azure-core-cpp/dt_android.patch30
-rw-r--r--vcpkg/ports/azure-core-cpp/portfile.cmake47
-rw-r--r--vcpkg/ports/azure-core-cpp/vcpkg.json82
3 files changed, 159 insertions, 0 deletions
diff --git a/vcpkg/ports/azure-core-cpp/dt_android.patch b/vcpkg/ports/azure-core-cpp/dt_android.patch
new file mode 100644
index 0000000..727e67f
--- /dev/null
+++ b/vcpkg/ports/azure-core-cpp/dt_android.patch
@@ -0,0 +1,30 @@
+diff --git a/sdk/core/azure-core/src/datetime.cpp b/sdk/core/azure-core/src/datetime.cpp
+index 288705b3d..750446dc4 100644
+--- a/sdk/core/azure-core/src/datetime.cpp
++++ b/sdk/core/azure-core/src/datetime.cpp
+@@ -50,11 +50,21 @@ DateTime GetMaxDateTime()
+ #pragma warning(disable : 6326)
+ #endif
+ static_assert(
+- std::is_same<DateTime::clock::duration::rep, std::chrono::system_clock::duration::rep>::value,
+- "DateTime::clock::duration::rep must be the same as "
+- "std::chrono::system_clock::duration::rep");
++ std::is_signed<std::chrono::system_clock::duration::rep>::value
++ && std::is_integral<std::chrono::system_clock::duration::rep>::value
++ && sizeof(std::chrono::system_clock::duration::rep) <= sizeof(std::int64_t),
++ "Currently, GetMaxDateTime() is written with an expectation that "
++ "std::chrono::system_clock::duration::rep is signed integral type that can fit into 64 "
++ "bits.");
+
+- using Rep = DateTime::clock::duration::rep;
++ static_assert(
++ std::is_signed<DateTime::clock::duration::rep>::value
++ && std::is_integral<DateTime::clock::duration::rep>::value
++ && sizeof(DateTime::clock::duration::rep) <= sizeof(std::int64_t),
++ "GetMaxDateTime() expects DateTime::clock::duration::rep to be signed integral type that can "
++ "fit into 64 bits.");
++
++ using Rep = std::int64_t;
+
+ using CommonDuration = std::chrono::duration<
+ Rep,
diff --git a/vcpkg/ports/azure-core-cpp/portfile.cmake b/vcpkg/ports/azure-core-cpp/portfile.cmake
new file mode 100644
index 0000000..c64b0eb
--- /dev/null
+++ b/vcpkg/ports/azure-core-cpp/portfile.cmake
@@ -0,0 +1,47 @@
+# NOTE: All changes made to this file will get overwritten by the next port release.
+# Please contribute your changes to https://github.com/Azure/azure-sdk-for-cpp.
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO Azure/azure-sdk-for-cpp
+ REF "azure-core_${VERSION}"
+ SHA512 30b949e1154674b474287a4b36a29270d9fdd7a1f5b43d2507859f0a75176821a98c9a700665b513cc5e36a8089d48d614838ed0f900f42ef5c87dd92f2805b6
+ HEAD_REF main
+ PATCHES
+ dt_android.patch
+)
+
+vcpkg_check_features(
+ OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ curl BUILD_TRANSPORT_CURL
+ winhttp BUILD_TRANSPORT_WINHTTP
+)
+
+file(GLOB_RECURSE unused "${SOURCE_PATH}/cgmanifest.json")
+file(REMOVE_RECURSE ${unused})
+
+if(EXISTS "${SOURCE_PATH}/sdk/core/azure-core")
+ file(REMOVE_RECURSE "${SOURCE_PATH}/sdk/core/_")
+ file(REMOVE_RECURSE "${SOURCE_PATH}/sdk/_")
+ file(REMOVE_RECURSE "${SOURCE_PATH}/_")
+
+ file(RENAME "${SOURCE_PATH}/sdk/core/azure-core" "${SOURCE_PATH}/sdk/core/_")
+ file(RENAME "${SOURCE_PATH}/sdk/core" "${SOURCE_PATH}/sdk/_")
+ file(RENAME "${SOURCE_PATH}/sdk" "${SOURCE_PATH}/_")
+endif()
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}/_/_/_"
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -DWARNINGS_AS_ERRORS=OFF
+ -DBUILD_TESTING=OFF
+ -DNO_AUTOMATIC_TRANSPORT_BUILD=ON
+)
+
+vcpkg_cmake_install()
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+vcpkg_cmake_config_fixup()
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+vcpkg_copy_pdbs()
diff --git a/vcpkg/ports/azure-core-cpp/vcpkg.json b/vcpkg/ports/azure-core-cpp/vcpkg.json
new file mode 100644
index 0000000..9c8e0c1
--- /dev/null
+++ b/vcpkg/ports/azure-core-cpp/vcpkg.json
@@ -0,0 +1,82 @@
+{
+ "$comment": [
+ "NOTE: All changes made to this file will get overwritten by the next port release.",
+ "Please contribute your changes to https://github.com/Azure/azure-sdk-for-cpp."
+ ],
+ "name": "azure-core-cpp",
+ "version-semver": "1.16.1",
+ "port-version": 1,
+ "description": [
+ "Microsoft Azure Core SDK for C++",
+ "This library provides shared primitives, abstractions, and helpers for modern Azure SDK client libraries written in the C++."
+ ],
+ "homepage": "https://github.com/Azure/azure-sdk-for-cpp/tree/main/sdk/core/azure-core",
+ "license": "MIT",
+ "dependencies": [
+ {
+ "name": "openssl",
+ "platform": "!windows & !uwp"
+ },
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "default-features": [
+ "http"
+ ],
+ "features": {
+ "curl": {
+ "description": "Libcurl HTTP transport implementation",
+ "dependencies": [
+ {
+ "name": "azure-core-cpp",
+ "default-features": false
+ },
+ {
+ "name": "curl",
+ "default-features": false,
+ "features": [
+ "ssl"
+ ]
+ }
+ ]
+ },
+ "http": {
+ "description": "All HTTP transport implementations available on the platform",
+ "dependencies": [
+ {
+ "name": "azure-core-cpp",
+ "default-features": false,
+ "features": [
+ "curl"
+ ]
+ },
+ {
+ "name": "azure-core-cpp",
+ "default-features": false,
+ "features": [
+ "curl",
+ "winhttp"
+ ],
+ "platform": "windows & !uwp"
+ }
+ ]
+ },
+ "winhttp": {
+ "description": "WinHTTP HTTP transport implementation",
+ "supports": "windows & !uwp",
+ "dependencies": [
+ {
+ "name": "azure-core-cpp",
+ "default-features": false
+ },
+ "wil"
+ ]
+ }
+ }
+}