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 } "
2023-06-06 02:23:14 +08:00
S H A 5 1 2 a 4 f 7 1 e 1 4 6 0 0 3 0 5 6 c 4 a 3 e 9 9 5 1 2 e 6 9 8 9 f d 4 a 3 7 b 5 9 4 3 d f c a f 5 9 3 b 7 b 2 7 6 2 3 1 c 4 2 6 a b d 2 e 1 f 6 0 d e 7 5 2 4 4 3 f b 6 2 a c 5 9 2 6 e c f 9 8 1 2 8 6 6 a f 3 c 8 c e 6 c 8 e e e d d f f c 9 2 f a 0 e b 5 a f b
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 ( )