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 } "
S H A 5 1 2 8 9 a a d b 2 d 0 7 7 f 5 8 e 5 4 5 0 f f 6 2 e 6 8 5 b 8 9 4 9 2 5 1 1 3 c e d f a 1 5 c d a 0 3 a 9 3 3 1 f b 9 a d c e d c d d 2 f 5 f d 5 1 a 8 e a e 0 7 1 9 1 4 3 5 6 6 b e f 8 9 c 6 5 8 b d 7 5 a 2 5 5 3 2 8 2 4 7 9 d 2 0 b 4 0 c 1 d 3 0 4 2 d 2 7 3
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 ( )