diff options
Diffstat (limited to 'vcpkg/ports/wepoll')
| -rw-r--r-- | vcpkg/ports/wepoll/CMakeLists.txt | 40 | ||||
| -rw-r--r-- | vcpkg/ports/wepoll/portfile.cmake | 29 | ||||
| -rw-r--r-- | vcpkg/ports/wepoll/vcpkg.json | 14 |
3 files changed, 83 insertions, 0 deletions
diff --git a/vcpkg/ports/wepoll/CMakeLists.txt b/vcpkg/ports/wepoll/CMakeLists.txt new file mode 100644 index 0000000..cd8d29a --- /dev/null +++ b/vcpkg/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/vcpkg/ports/wepoll/portfile.cmake b/vcpkg/ports/wepoll/portfile.cmake new file mode 100644 index 0000000..73b488f --- /dev/null +++ b/vcpkg/ports/wepoll/portfile.cmake @@ -0,0 +1,29 @@ +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.8
+ SHA512 e87fbdd0f64a06910fdf29565acff0443b500c409cf7456657829ece3674563581a5c9a298f9ac70f5a0bb78c0a5eb17cfd1a164ab5cbd6fdaacd19d015a3f85
+ HEAD_REF dist
+)
+
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+)
+
+vcpkg_cmake_install()
+
+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)
diff --git a/vcpkg/ports/wepoll/vcpkg.json b/vcpkg/ports/wepoll/vcpkg.json new file mode 100644 index 0000000..53bb601 --- /dev/null +++ b/vcpkg/ports/wepoll/vcpkg.json @@ -0,0 +1,14 @@ +{ + "name": "wepoll", + "version": "1.5.8", + "port-version": 3, + "description": "Fast epoll for windows", + "homepage": "https://github.com/piscisaureus/wepoll", + "supports": "windows", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + } + ] +} |