aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libunifex
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/libunifex')
-rw-r--r--vcpkg/ports/libunifex/fix-compile-error.patch15
-rw-r--r--vcpkg/ports/libunifex/fix-linux-timespec.patch13
-rw-r--r--vcpkg/ports/libunifex/portfile.cmake44
-rw-r--r--vcpkg/ports/libunifex/vcpkg.json25
4 files changed, 97 insertions, 0 deletions
diff --git a/vcpkg/ports/libunifex/fix-compile-error.patch b/vcpkg/ports/libunifex/fix-compile-error.patch
new file mode 100644
index 0000000..3cbd545
--- /dev/null
+++ b/vcpkg/ports/libunifex/fix-compile-error.patch
@@ -0,0 +1,15 @@
+diff --git a/cmake/unifex_env.cmake b/cmake/unifex_env.cmake
+index b26aed1..051a7af 100644
+--- a/cmake/unifex_env.cmake
++++ b/cmake/unifex_env.cmake
+@@ -21,8 +21,8 @@ endif()
+
+ if (UNIFEX_CXX_COMPILER_MSVC)
+ # warning level 3 and all warnings as errors
+- add_compile_options(/W3 /WX)
++ add_compile_options(/W3 /WX /Zc:externConstexpr /EHsc)
+ else()
+ # lots of warnings and all warnings as errors
+- add_compile_options(-Wall -Wextra -pedantic -Werror)
++ add_compile_options(-Wall -Wextra -pedantic)
+ endif()
diff --git a/vcpkg/ports/libunifex/fix-linux-timespec.patch b/vcpkg/ports/libunifex/fix-linux-timespec.patch
new file mode 100644
index 0000000..99c2398
--- /dev/null
+++ b/vcpkg/ports/libunifex/fix-linux-timespec.patch
@@ -0,0 +1,13 @@
+diff --git a/source/linux/io_uring_context.cpp b/source/linux/io_uring_context.cpp
+index f869b3f..8300961 100644
+--- a/source/linux/io_uring_context.cpp
++++ b/source/linux/io_uring_context.cpp
+@@ -17,7 +17,7 @@
+ #include <unifex/config.hpp>
+
+ #if !UNIFEX_NO_LIBURING
+-
++#include <linux/time_types.h>
+ #include <unifex/linux/io_uring_context.hpp>
+
+ #include <unifex/scope_guard.hpp>
diff --git a/vcpkg/ports/libunifex/portfile.cmake b/vcpkg/ports/libunifex/portfile.cmake
new file mode 100644
index 0000000..fbc11b0
--- /dev/null
+++ b/vcpkg/ports/libunifex/portfile.cmake
@@ -0,0 +1,44 @@
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO facebookexperimental/libunifex
+ REF "v${VERSION}"
+ SHA512 9625a248b9ed43f7ac8e3da054020e7c5c71d3da253cfa587ee62eb8a1d4cfee794758b7d28896e4038c1924b204c92be7230c20cf525684e2c304ceaa4a6321
+ HEAD_REF main
+ PATCHES
+ fix-compile-error.patch
+ fix-linux-timespec.patch
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ coroutines CXX_COROUTINES_HAVE_COROUTINES
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH ${SOURCE_PATH}
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -DCMAKE_CXX_STANDARD:STRING=20
+ -DBUILD_TESTING=OFF
+ -DUNIFEX_BUILD_EXAMPLES=OFF
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(PACKAGE_NAME unifex CONFIG_PATH lib/cmake/unifex)
+vcpkg_copy_pdbs()
+vcpkg_fixup_pkgconfig()
+
+file(INSTALL "${SOURCE_PATH}/LICENSE.txt"
+ DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include"
+ "${CURRENT_PACKAGES_DIR}/debug/share"
+ "${CURRENT_PACKAGES_DIR}/include/unifex/config.hpp.in"
+)
+if(VCPKG_TARGET_IS_WINDOWS)
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/unifex/linux")
+elseif(VCPKG_TARGET_IS_LINUX)
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/unifex/win32")
+endif()
diff --git a/vcpkg/ports/libunifex/vcpkg.json b/vcpkg/ports/libunifex/vcpkg.json
new file mode 100644
index 0000000..4bc86b5
--- /dev/null
+++ b/vcpkg/ports/libunifex/vcpkg.json
@@ -0,0 +1,25 @@
+{
+ "name": "libunifex",
+ "version": "0.4.0",
+ "description": "Unified Executors",
+ "homepage": "https://github.com/facebookexperimental/libunifex",
+ "dependencies": [
+ {
+ "name": "liburing",
+ "platform": "linux"
+ },
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "coroutines": {
+ "description": "Support coroutine"
+ }
+ }
+}