aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/aws-c-common
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/aws-c-common')
-rw-r--r--vcpkg/ports/aws-c-common/disable-internal-crt-option.patch20
-rw-r--r--vcpkg/ports/aws-c-common/portfile.cmake33
-rw-r--r--vcpkg/ports/aws-c-common/vcpkg.json18
3 files changed, 71 insertions, 0 deletions
diff --git a/vcpkg/ports/aws-c-common/disable-internal-crt-option.patch b/vcpkg/ports/aws-c-common/disable-internal-crt-option.patch
new file mode 100644
index 0000000..28cb478
--- /dev/null
+++ b/vcpkg/ports/aws-c-common/disable-internal-crt-option.patch
@@ -0,0 +1,20 @@
+diff --git a/cmake/AwsCFlags.cmake b/cmake/AwsCFlags.cmake
+index 470f6db..537536b 100644
+--- a/cmake/AwsCFlags.cmake
++++ b/cmake/AwsCFlags.cmake
+@@ -82,15 +82,6 @@ function(aws_set_common_properties target)
+ list(APPEND AWS_C_FLAGS /DAWS_SUPPORT_WIN7=1)
+ endif()
+
+- # Set MSVC runtime libary.
+- # Note: there are other ways of doing this if we bump our CMake minimum to 3.14+
+- # See: https://cmake.org/cmake/help/latest/policy/CMP0091.html
+- if (AWS_STATIC_MSVC_RUNTIME_LIBRARY OR STATIC_CRT)
+- list(APPEND AWS_C_FLAGS "/MT$<$<CONFIG:Debug>:d>")
+- else()
+- list(APPEND AWS_C_FLAGS "/MD$<$<CONFIG:Debug>:d>")
+- endif()
+-
+ else()
+ list(APPEND AWS_C_FLAGS -Wall -Wstrict-prototypes)
+
diff --git a/vcpkg/ports/aws-c-common/portfile.cmake b/vcpkg/ports/aws-c-common/portfile.cmake
new file mode 100644
index 0000000..6504712
--- /dev/null
+++ b/vcpkg/ports/aws-c-common/portfile.cmake
@@ -0,0 +1,33 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO awslabs/aws-c-common
+ REF "v${VERSION}"
+ SHA512 3f211e4d7737e756b6bda0de965570c3c04588e4f10dddf17f21ced1937a8dc6ddb5aeca52b96d7ead3cfb53e05ad99155d17045ea0da7f964372357046041ca
+ HEAD_REF master
+ PATCHES
+ disable-internal-crt-option.patch # Disable internal crt option because vcpkg contains crt processing flow
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DBUILD_TESTING=FALSE
+)
+
+vcpkg_cmake_install()
+
+string(REPLACE "dynamic" "shared" subdir "${VCPKG_LIBRARY_LINKAGE}")
+vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}/${subdir}" DO_NOT_DELETE_PARENT_CONFIG_PATH)
+vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}")
+vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/${PORT}-config.cmake" [[/${type}/]] "/")
+
+file(REMOVE_RECURSE
+ "${CURRENT_PACKAGES_DIR}/debug/include"
+ "${CURRENT_PACKAGES_DIR}/debug/lib/${PORT}"
+ "${CURRENT_PACKAGES_DIR}/debug/share"
+ "${CURRENT_PACKAGES_DIR}/lib/${PORT}"
+)
+
+vcpkg_copy_pdbs()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/aws-c-common/vcpkg.json b/vcpkg/ports/aws-c-common/vcpkg.json
new file mode 100644
index 0000000..a6edaaa
--- /dev/null
+++ b/vcpkg/ports/aws-c-common/vcpkg.json
@@ -0,0 +1,18 @@
+{
+ "name": "aws-c-common",
+ "version": "0.12.5",
+ "description": "AWS common library for C",
+ "homepage": "https://github.com/awslabs/aws-c-common",
+ "license": "Apache-2.0",
+ "supports": "!(windows & arm32) & !uwp",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}