mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 10:21:07 +08:00
[uWebSockets] Upgrades 2019.03.29 (#6133)
This commit is contained in:
parent
bba224b978
commit
b742476971
44
ports/usockets/CMakeLists.txt
Normal file
44
ports/usockets/CMakeLists.txt
Normal file
@ -0,0 +1,44 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(uSockets C CXX)
|
||||
|
||||
option(INSTALL_HEADERS "Install header files" ON)
|
||||
|
||||
# To enable this feature, OpenSSL 1.1+ is required and is currently disabled due to issue 4267
|
||||
if (CMAKE_USE_OPENSSL)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
set(USE_OPENSSL "-DUSE_OPENSSL -DLIBUS_USE_OPENSSL")
|
||||
#set(OPENSSL_LIB "OpenSSL::SSL OpenSSL::Crypto")
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
|
||||
else()
|
||||
set(NOT_USE_OPENSSL "-DLIBUS_NO_SSL")
|
||||
endif()
|
||||
|
||||
find_package(unofficial-libuv CONFIG REQUIRED)
|
||||
find_path(LIBUV_INCLUDE_DIR uv.h)
|
||||
find_library(LIBUV_LIBRARY NAMES libuv)
|
||||
include_directories(APPEND "${CMAKE_CURRENT_LIST_DIR}/src")
|
||||
|
||||
file(GLOB SOURCES src/*.c src/eventing/*.c)
|
||||
|
||||
add_library(uSockets ${SOURCES})
|
||||
|
||||
if (${LIBUS_USE_LIBUV})
|
||||
target_compile_definitions(uSockets PRIVATE -DLIBUS_USE_LIBUV)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(uSockets PRIVATE ${NOT_USE_OPENSSL} ${USE_OPENSSL})
|
||||
target_include_directories(uSockets PUBLIC ${OPENSSL_INCLUDE_DIR} ${LIBUV_INCLUDE_DIR} )
|
||||
target_link_libraries(uSockets PUBLIC ${OPENSSL_LIBRARIES} ${LIBUV_LIBRARY})
|
||||
|
||||
install(TARGETS uSockets
|
||||
RUNTIME DESTINATION bin
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
)
|
||||
|
||||
if(INSTALL_HEADERS)
|
||||
file(GLOB HEADERS src/*.h)
|
||||
install(FILES ${HEADERS} DESTINATION include)
|
||||
file(GLOB HEADERS src/interfaces/*.h)
|
||||
install(FILES ${HEADERS} DESTINATION include/interfaces)
|
||||
endif()
|
4
ports/usockets/CONTROL
Normal file
4
ports/usockets/CONTROL
Normal file
@ -0,0 +1,4 @@
|
||||
Source: usockets
|
||||
Version: 0.1.2
|
||||
Build-Depends:libuv
|
||||
Description: Miniscule cross-platform eventing, networking & crypto for async applications
|
34
ports/usockets/portfile.cmake
Normal file
34
ports/usockets/portfile.cmake
Normal file
@ -0,0 +1,34 @@
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
IF (NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(USE_LIBUV ON)
|
||||
EndIF ()
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO uNetworking/uSockets
|
||||
REF v0.1.2
|
||||
SHA512 fedfc50e3498320600247920360db38977f5be4aa9067146a5a0db13dc789b8fa39fa9315b19f56555915bcb818cd0f77ccf0b8cb40ed48e2b193b083d16b242
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
|
||||
set(USE_OPENSSL OFF)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DCMAKE_USE_OPENSSL=${USE_OPENSSL}
|
||||
-DLIBUS_USE_LIBUV=${USE_LIBUV}
|
||||
OPTIONS_DEBUG
|
||||
-DINSTALL_HEADERS=OFF
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/usockets)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/usockets/LICENSE ${CURRENT_PACKAGES_DIR}/share/usockets/copyright)
|
||||
|
||||
vcpkg_copy_pdbs()
|
@ -1,25 +0,0 @@
|
||||
project(uwebsockets CXX)
|
||||
|
||||
option(INSTALL_HEADERS "Install header files" ON)
|
||||
|
||||
find_package(ZLIB REQUIRED)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
find_path(LIBUV_INCLUDE_DIR uv.h)
|
||||
find_library(LIBUV_LIBRARY NAMES libuv)
|
||||
|
||||
file(GLOB SOURCES src/*.cpp)
|
||||
add_library(uWS ${SOURCES})
|
||||
target_include_directories(uWS PUBLIC ${OPENSSL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS})
|
||||
target_link_libraries(uWS PUBLIC ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${LIBUV_LIBRARY})
|
||||
target_compile_features(uWS PRIVATE cxx_range_for)
|
||||
|
||||
install(TARGETS uWS
|
||||
RUNTIME DESTINATION bin
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
)
|
||||
|
||||
if(INSTALL_HEADERS)
|
||||
file(GLOB HEADERS src/*.h)
|
||||
install(FILES ${HEADERS} DESTINATION include/uWS)
|
||||
endif()
|
@ -1,4 +1,4 @@
|
||||
Source: uwebsockets
|
||||
Version: 0.14.8-2
|
||||
Build-Depends: libuv, openssl, zlib
|
||||
Description: Highly scalable cross-platform WebSocket & HTTP library for C++11 and Node.js
|
||||
Version: 0.15.6
|
||||
Build-Depends: zlib, usockets
|
||||
Description: Simple, secure & standards compliant web I/O for the most demanding of applications
|
||||
|
@ -2,24 +2,15 @@ include(vcpkg_common_functions)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO uWebSockets/uWebSockets
|
||||
REF v0.14.8
|
||||
SHA512 5e78e2f10e95648ad1e7f26612f69da3bbdcdb3f17c99e3bb9775e3eb440a2741f05375dcc043b43f0f2d4de6da54e7534431c5c10c1350103a4379b55cf9081
|
||||
REPO uNetworking/uWebSockets
|
||||
REF v0.15.6
|
||||
SHA512 ba5dc18412ecceadb48e3c0f9b6f6d9ea920b76c36b12456bc96198346149010257c0f7807a1e1cc262ae0eca07e1994d3f1e3be0b3c815ce455d778c5375311
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS_DEBUG
|
||||
-DINSTALL_HEADERS=OFF
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
file(COPY ${SOURCE_PATH}/src DESTINATION ${CURRENT_PACKAGES_DIR}/include)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/include/src ${CURRENT_PACKAGES_DIR}/include/uwebsockets/)
|
||||
|
||||
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/uwebsockets)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/uwebsockets/LICENSE ${CURRENT_PACKAGES_DIR}/share/uwebsockets/copyright)
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
Loading…
x
Reference in New Issue
Block a user