aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/uwebsockets
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/uwebsockets')
-rw-r--r--vcpkg/ports/uwebsockets/portfile.cmake23
-rw-r--r--vcpkg/ports/uwebsockets/unofficial-uwebsockets-config.cmake26
-rw-r--r--vcpkg/ports/uwebsockets/vcpkg.json35
3 files changed, 84 insertions, 0 deletions
diff --git a/vcpkg/ports/uwebsockets/portfile.cmake b/vcpkg/ports/uwebsockets/portfile.cmake
new file mode 100644
index 0000000..f20e7f4
--- /dev/null
+++ b/vcpkg/ports/uwebsockets/portfile.cmake
@@ -0,0 +1,23 @@
+# header-only library
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO uNetworking/uWebSockets
+ REF "v${VERSION}"
+ SHA512 a2a46ae4f92eb31c43bd717d75003db5930462a10eb7a48b80b662f77a53af4fc24cf3209857ba01a7317784469a63386731271df4edf7ab99fe748ad709387c
+ HEAD_REF master
+)
+
+file(COPY "${SOURCE_PATH}/src" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
+file(RENAME "${CURRENT_PACKAGES_DIR}/include/src" "${CURRENT_PACKAGES_DIR}/include/uwebsockets")
+
+set(UWS_NO_LIBDEFLATE 1)
+if("libdeflate" IN_LIST FEATURES)
+ set(UWS_NO_LIBDEFLATE 0)
+endif()
+set(UWS_NO_ZLIB 1)
+if("zlib" IN_LIST FEATURES)
+ set(UWS_NO_ZLIB 0)
+endif()
+configure_file("${CURRENT_PORT_DIR}/unofficial-uwebsockets-config.cmake" "${CURRENT_PACKAGES_DIR}/share/unofficial-uwebsockets/unofficial-uwebsockets-config.cmake" @ONLY)
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/uwebsockets/unofficial-uwebsockets-config.cmake b/vcpkg/ports/uwebsockets/unofficial-uwebsockets-config.cmake
new file mode 100644
index 0000000..d6c5488
--- /dev/null
+++ b/vcpkg/ports/uwebsockets/unofficial-uwebsockets-config.cmake
@@ -0,0 +1,26 @@
+include(CMakeFindDependencyMacro)
+find_dependency(unofficial-usockets CONFIG)
+if(NOT "@UWS_NO_LIBDEFLATE@")
+ find_dependency(libdeflate)
+endif()
+if(NOT "@UWS_NO_ZLIB@")
+ find_dependency(ZLIB)
+endif()
+
+if(NOT TARGET unofficial::uwebsockets::uwebsockets)
+ add_library(unofficial::uwebsockets::uwebsockets INTERFACE IMPORTED)
+ target_compile_features(unofficial::uwebsockets::uwebsockets INTERFACE cxx_std_17)
+ get_filename_component(_uws_include_dir "../../include" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
+ target_include_directories(unofficial::uwebsockets::uwebsockets INTERFACE "${_uws_include_dir}")
+ unset(_uws_include_dir)
+ target_link_libraries(unofficial::uwebsockets::uwebsockets INTERFACE $<LINK_ONLY:unofficial::usockets::usockets>)
+ if(NOT "@UWS_NO_LIBDEFLATE@")
+ target_compile_definitions(unofficial::uwebsockets::uwebsockets INTERFACE UWS_USE_LIBDEFLATE)
+ target_link_libraries(unofficial::uwebsockets::uwebsockets INTERFACE $<IF:$<TARGET_EXISTS:libdeflate::libdeflate_shared>,libdeflate::libdeflate_shared,libdeflate::libdeflate_static>)
+ endif()
+ if("@UWS_NO_ZLIB@")
+ target_compile_definitions(unofficial::uwebsockets::uwebsockets INTERFACE UWS_NO_ZLIB)
+ else()
+ target_link_libraries(unofficial::uwebsockets::uwebsockets INTERFACE ZLIB::ZLIB)
+ endif()
+endif()
diff --git a/vcpkg/ports/uwebsockets/vcpkg.json b/vcpkg/ports/uwebsockets/vcpkg.json
new file mode 100644
index 0000000..4b9f81f
--- /dev/null
+++ b/vcpkg/ports/uwebsockets/vcpkg.json
@@ -0,0 +1,35 @@
+{
+ "name": "uwebsockets",
+ "version-semver": "20.74.0",
+ "description": "Simple, secure & standards compliant web I/O for the most demanding of applications",
+ "homepage": "https://github.com/uWebSockets/uWebSockets",
+ "license": "Apache-2.0",
+ "dependencies": [
+ "usockets"
+ ],
+ "features": {
+ "libdeflate": {
+ "description": "Enable libdeflate support",
+ "dependencies": [
+ "libdeflate"
+ ]
+ },
+ "ssl": {
+ "description": "Enable SSL support",
+ "dependencies": [
+ {
+ "name": "usockets",
+ "features": [
+ "ssl"
+ ]
+ }
+ ]
+ },
+ "zlib": {
+ "description": "Enable ZLIB support",
+ "dependencies": [
+ "zlib"
+ ]
+ }
+ }
+}