aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormyd7349 <myd7349@gmail.com>2019-09-28 23:54:09 +0800
committerCurtis J Bezault <curtbezault@gmail.com>2019-09-28 08:54:09 -0700
commit60c5814063629d9911a36ef1abd77f4ba9af8e14 (patch)
tree4fe1df0dcf547bb5d69ea60cdae14147dd38ad07
parent39ae95f5a97a541f6b08472b46c9517b192fdde8 (diff)
downloadvcpkg-60c5814063629d9911a36ef1abd77f4ba9af8e14.tar.gz
vcpkg-60c5814063629d9911a36ef1abd77f4ba9af8e14.zip
[wepoll] Add new port (#8280)
* [wepoll] Add new port * [wepoll] Switch to dist branch
-rw-r--r--ports/wepoll/CMakeLists.txt40
-rw-r--r--ports/wepoll/CONTROL4
-rw-r--r--ports/wepoll/portfile.cmake32
3 files changed, 76 insertions, 0 deletions
diff --git a/ports/wepoll/CMakeLists.txt b/ports/wepoll/CMakeLists.txt
new file mode 100644
index 000000000..cd8d29a2c
--- /dev/null
+++ b/ports/wepoll/CMakeLists.txt
@@ -0,0 +1,40 @@
+cmake_minimum_required(VERSION 3.14)
+
+project(wepoll C)
+
+add_library(wepoll wepoll.c)
+
+if (MSVC)
+ if (BUILD_SHARED_LIBS)
+ target_compile_definitions(
+ wepoll
+ PRIVATE
+ "-DWEPOLL_EXPORT=__declspec(dllexport)"
+ )
+ endif ()
+
+ target_compile_options(wepoll PRIVATE /Wall /wd4127 /wd4201 /wd4242 /wd4710 /wd4711 /wd4820)
+
+ if (MSVC_VERSION GREATER_EQUAL 1900)
+ target_compile_options(wepoll PRIVATE /wd5045)
+ endif ()
+else ()
+ target_compile_definitions(
+ wepoll
+ PRIVATE
+ "-DWEPOLL_EXPORT=__attribute__((visibility(\"default\")))"
+ )
+
+ target_compile_options(wepoll PRIVATE -Wall -Wextra -Werror -fvisibility=hidden)
+endif ()
+
+target_link_libraries(wepoll PUBLIC ws2_32)
+
+set_target_properties(
+ wepoll
+ PROPERTIES
+ OUTPUT_NAME wepoll
+ PUBLIC_HEADER wepoll.h
+)
+
+install(TARGETS wepoll)
diff --git a/ports/wepoll/CONTROL b/ports/wepoll/CONTROL
new file mode 100644
index 000000000..003405ef6
--- /dev/null
+++ b/ports/wepoll/CONTROL
@@ -0,0 +1,4 @@
+Source: wepoll
+Version: 1.5.5
+Description: Fast epoll for windows
+Homepage: https://github.com/piscisaureus/wepoll
diff --git a/ports/wepoll/portfile.cmake b/ports/wepoll/portfile.cmake
new file mode 100644
index 000000000..53f1ca1a4
--- /dev/null
+++ b/ports/wepoll/portfile.cmake
@@ -0,0 +1,32 @@
+include(vcpkg_common_functions)
+
+if(NOT VCPKG_TARGET_IS_WINDOWS)
+ message(FATAL_ERROR "${PORT} only supports Windows.")
+endif()
+
+# We use `dist` branch instead of `master` branch here,
+# as suggested by the library author.
+# https://github.com/microsoft/vcpkg/pull/8280
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO piscisaureus/wepoll
+ REF v1.5.5
+ SHA512 af4507e864b0345a5842c71f4a036488ed51e53a310c7b76e7caef89f29c3a53bf7ccfea8ac4aaea386de1d1e589425004fc16bc31b2900a0ba730f0a54cb357
+ HEAD_REF dist
+)
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+)
+
+vcpkg_install_cmake()
+
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+# Handle copyright
+configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)