diff options
Diffstat (limited to 'vcpkg/ports/discordcoreapi')
| -rw-r--r-- | vcpkg/ports/discordcoreapi/portfile.cmake | 38 | ||||
| -rw-r--r-- | vcpkg/ports/discordcoreapi/vcpkg.json | 22 |
2 files changed, 60 insertions, 0 deletions
diff --git a/vcpkg/ports/discordcoreapi/portfile.cmake b/vcpkg/ports/discordcoreapi/portfile.cmake new file mode 100644 index 0000000..eb99479 --- /dev/null +++ b/vcpkg/ports/discordcoreapi/portfile.cmake @@ -0,0 +1,38 @@ +if(VCPKG_TARGET_IS_LINUX)
+ message(WARNING "DiscordCoreAPI only supports g++ 11 on linux.")
+endif()
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO RealTimeChris/DiscordCoreAPI
+ REF "v${VERSION}"
+ SHA512 d977ed7d8805f0b110450d3baf0256eae11ecc25947496c657a9c9b17aa9222db92435f28ebd924c166927e4714b3e9ae388f64836175cc96b78b08315031ede
+ HEAD_REF main
+)
+
+# discordcoreapi consumes extreme amounts of memory (>9GB per .cpp file). With our default
+# concurrency values this causes hanging and/or OOM killing on Linux build machines and
+# warnings on the Windows machines like:
+# #[warning]Free memory is lower than 5%; Currently used: 99.99%
+# #[warning]Free memory is lower than 5%; Currently used: 99.99%
+# #[warning]Free memory is lower than 5%; Currently used: 99.99%
+# Cut the requested concurrency in quarter to avoid this.
+if(VCPKG_CONCURRENCY GREATER 4)
+ math(EXPR VCPKG_CONCURRENCY "${VCPKG_CONCURRENCY} / 4")
+endif()
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+)
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(NO_PREFIX_CORRECTION)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
+endif()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/License.md")
diff --git a/vcpkg/ports/discordcoreapi/vcpkg.json b/vcpkg/ports/discordcoreapi/vcpkg.json new file mode 100644 index 0000000..f15ce5e --- /dev/null +++ b/vcpkg/ports/discordcoreapi/vcpkg.json @@ -0,0 +1,22 @@ +{ + "name": "discordcoreapi", + "version": "2.0.8", + "description": "A Discord bot library written in C++ using custom asynchronous coroutines.", + "homepage": "https://discordcoreapi.com", + "license": "MIT", + "supports": "(windows & x64 & !xbox) | (linux & x64) | (osx & x64)", + "dependencies": [ + "jsonifier", + "libsodium", + "openssl", + "opus", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |