[sockpp] Add new port (#11562)

* [sockpp] Add new port

* [sockpp] Address review comments

* [sockpp] Update ci.baseline

* [sockpp] Fix typo

* [sockpp] Fix sockppConfig.cmake
This commit is contained in:
Ankush Singh 2020-06-02 07:40:23 +05:30 committed by GitHub
parent e7041e1ef6
commit f5676127ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 67 additions and 0 deletions

5
ports/sockpp/CONTROL Normal file
View File

@ -0,0 +1,5 @@
Source: sockpp
Version: 0.7
Homepage: https://github.com/fpagliughi/sockpp
Description: Simple, modern, C++ socket library. This is a fairly low-level C++ wrapper around the Berkeley sockets library using socket, acceptor, and connector classes that are familiar concepts from other languages.
Supports: !uwp

View File

@ -0,0 +1,32 @@
vcpkg_fail_port_install(ON_TARGET "uwp")
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO fpagliughi/sockpp
REF d8c86c01db43542a06ad05424da037f6b9892253
SHA512 9b7ae3fea08bfd4a0d6479d7fbcc24da9101476c4f8e4a684138c7d974827cdf374282a4641e58f03c08aeb83f2c1856fc3c5193e5847fb4b3d9182c1c396087
HEAD_REF master
)
vcpkg_replace_string(${SOURCE_PATH}/CMakeLists.txt "\${SOCKPP}-static" "\${SOCKPP}")
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DSOCKPP_BUILD_SHARED=OFF
-DSOCKPP_BUILD_STATIC=ON
-DSOCKPP_BUILD_DOCUMENTATION=OFF
-DSOCKPP_BUILD_EXAMPLES=OFF
-DSOCKPP_BUILD_TESTS=OFF
)
vcpkg_install_cmake()
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL ${CURRENT_PORT_DIR}/sockppConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})

View File

@ -0,0 +1,23 @@
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE)
if(NOT SOCKPP_FIND_COMPONENTS)
set(SOCKPP_FIND_COMPONENTS sockpp)
if(SOCKPP_FIND_REQUIRED)
set(SOCKPP_FIND_REQUIRED_sockpp TRUE)
endif()
set(SOCKPP_FOUND TRUE)
endif()
set(SOCKPP_INCLUDE_DIRS ${_DIR}/include)
set(SOCKPP_LIBRARIES)
if (EXISTS ${_DIR}/lib/libsockpp.a)
list(APPEND SOCKPP_LIBRARIES optimized ${_DIR}/lib/libsockpp.a)
endif()
if (EXISTS ${_DIR}/debug/lib/libsockpp.a)
list(APPEND SOCKPP_LIBRARIES debug ${_DIR}/debug/lib/libsockpp.a)
endif()
if (EXISTS ${_DIR}/lib/sockpp.lib)
list(APPEND SOCKPP_LIBRARIES optimized ${_DIR}/lib/sockpp.lib)
endif()
if (EXISTS ${_DIR}/debug/lib/sockpp.lib)
list(APPEND SOCKPP_LIBRARIES debug ${_DIR}/debug/lib/sockpp.lib)
endif()

5
ports/sockpp/usage Normal file
View File

@ -0,0 +1,5 @@
The package sockpp provides CMake integration:
find_package(sockpp CONFIG REQUIRED)
target_include_directories(main PRIVATE ${SOCKPP_INCLUDE_DIRS})
target_link_libraries(main PRIVATE ${SOCKPP_LIBRARIES})

View File

@ -1714,6 +1714,8 @@ smpeg2:x64-linux=fail
smpeg2:x64-uwp=fail
soci:arm-uwp=fail
soci:x64-uwp=fail
sockpp:arm-uwp=fail
sockpp:x64-uwp=fail
soem:x64-uwp=fail
soem:arm-uwp=fail
soil:arm-uwp=fail