mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 07:38:59 +08:00
026b589594
- [V] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [V] SHA512s are updated for each updated download. - [V] The "supports" clause reflects platforms that may be fixed by this new version. - [V] Any fixed [CI baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt) entries are removed from that file. - [V] Any patches that are no longer applied are deleted from the port's directory. - [V] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [V] Only one version is added to each modified port's versions file.
43 lines
1.2 KiB
CMake
43 lines
1.2 KiB
CMake
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY) #Upstream only support static compilation: https://github.com/uNetworking/uSockets/commit/b950efd6b10f06dd3ecb5b692e5d415f48474647
|
|
|
|
if(NOT VCPKG_TARGET_IS_LINUX)
|
|
set(USE_LIBUV ON)
|
|
endif()
|
|
|
|
if ("network" IN_LIST FEATURES AND NOT VCPKG_TARGET_IS_WINDOWS)
|
|
message(FATAL_ERROR "Feature 'network' is only supported on Windows")
|
|
endif()
|
|
|
|
vcpkg_from_github(
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
REPO uNetworking/uSockets
|
|
REF "v${VERSION}"
|
|
SHA512 726b1665209d0006d6621352c12019bbab22bed75450c5ef1509b409d3c19c059caf94775439d3b910676fa2a4a790d490c3e25e5b8141423d88823642be7ac7
|
|
HEAD_REF master
|
|
)
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
FEATURES
|
|
ssl CMAKE_USE_OPENSSL
|
|
event CMAKE_USE_EVENT
|
|
network CMAKE_USE_NETWORK
|
|
)
|
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
|
|
|
vcpkg_cmake_configure(
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
OPTIONS
|
|
${FEATURE_OPTIONS}
|
|
"-DLIBUS_USE_LIBUV=${USE_LIBUV}"
|
|
OPTIONS_DEBUG
|
|
-DINSTALL_HEADERS=OFF
|
|
)
|
|
|
|
vcpkg_cmake_install()
|
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
|
|
|
vcpkg_copy_pdbs()
|