2023-01-12 15:07:33 +08:00
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
2021-10-06 07:36:01 +08:00
if ( NOT VCPKG_TARGET_IS_LINUX )
2019-05-03 04:53:28 +08:00
set ( USE_LIBUV ON )
2021-10-06 07:36:01 +08:00
endif ( )
if ( "network" IN_LIST FEATURES AND NOT VCPKG_TARGET_IS_WINDOWS )
message ( FATAL_ERROR "Feature 'network' is only supported on Windows" )
endif ( )
2019-05-03 04:53:28 +08:00
vcpkg_from_github (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
R E P O u N e t w o r k i n g / u S o c k e t s
2023-01-12 15:07:33 +08:00
R E F " v $ { V E R S I O N } "
2024-05-04 06:22:13 +08:00
S H A 5 1 2 7 2 6 b 1 6 6 5 2 0 9 d 0 0 0 6 d 6 6 2 1 3 5 2 c 1 2 0 1 9 b b a b 2 2 b e d 7 5 4 5 0 c 5 e f 1 5 0 9 b 4 0 9 d 3 c 1 9 c 0 5 9 c a f 9 4 7 7 5 4 3 9 d 3 b 9 1 0 6 7 6 f a 2 a 4 a 7 9 0 d 4 9 0 c 3 e 2 5 e 5 b 8 1 4 1 4 2 3 d 8 8 8 2 3 6 4 2 b e 7 a c 7
2019-05-03 04:53:28 +08:00
H E A D _ R E F m a s t e r
)
2020-03-05 02:38:47 +08:00
vcpkg_check_features ( OUT_FEATURE_OPTIONS FEATURE_OPTIONS
2021-10-06 07:36:01 +08:00
F E A T U R E S
s s l C M A K E _ U S E _ O P E N S S L
e v e n t C M A K E _ U S E _ E V E N T
n e t w o r k C M A K E _ U S E _ N E T W O R K
2020-03-05 02:38:47 +08:00
)
2019-05-03 04:53:28 +08:00
2021-10-06 07:36:01 +08:00
file ( COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}" )
vcpkg_cmake_configure (
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
O P T I O N S
$ { F E A T U R E _ O P T I O N S }
" - D L I B U S _ U S E _ L I B U V = $ { U S E _ L I B U V } "
2019-05-03 04:53:28 +08:00
O P T I O N S _ D E B U G
- D I N S T A L L _ H E A D E R S = O F F
)
2021-10-06 07:36:01 +08:00
vcpkg_cmake_install ( )
2019-05-03 04:53:28 +08:00
2023-01-12 15:07:33 +08:00
vcpkg_install_copyright ( FILE_LIST "${SOURCE_PATH}/LICENSE" )
2019-05-03 04:53:28 +08:00
2021-01-20 02:55:29 +08:00
vcpkg_copy_pdbs ( )