Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libunifex] create a new port #19279

Merged
merged 9 commits into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ports/libunifex/allow-warnings.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/cmake/unifex_env.cmake b/cmake/unifex_env.cmake
index cb99ae4..9825532 100644
--- a/cmake/unifex_env.cmake
+++ b/cmake/unifex_env.cmake
@@ -21,8 +21,8 @@ endif()

if (MSVC)
# warning level 3 and all warnings as errors
- add_compile_options(/W3 /WX)
+ add_compile_options(/W3)
else()
# lots of warnings and all warnings as errors
- add_compile_options(-Wall -Wextra -pedantic -Werror)
+ add_compile_options(-Wall -Wextra -pedantic)
endif()
33 changes: 33 additions & 0 deletions ports/libunifex/fix-install.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
index 3f25517..3c34a54 100644
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -67,10 +67,27 @@ configure_file(
target_include_directories(unifex
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include/>
- "${PROJECT_BINARY_DIR}/include")
+ $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
+)

target_compile_features(unifex PUBLIC cxx_std_17)

if(CXX_COROUTINES_HAVE_COROUTINES)
target_link_libraries(unifex PUBLIC std::coroutines)
endif()
+
+install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/unifex
+ DESTINATION include
+)
+install(FILES ${PROJECT_BINARY_DIR}/include/unifex/config.hpp
+ DESTINATION include/unifex
+)
+
+install(TARGETS unifex
+ EXPORT unifex-config
+ DESTINATION lib
+)
+install(EXPORT unifex-config
+ NAMESPACE unofficial::
+ DESTINATION lib/cmake/unifex
+)
40 changes: 40 additions & 0 deletions ports/libunifex/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO facebookexperimental/libunifex
REF e36b43834329acc75f99910316d3ecec15c0f665
SHA512 58f738b49d18982fd3916500c78e8090a266738ec4a8ba416b004fa2c7db718db5ce0e27f5e4e22eaddcc27c8d1618bcb2bc080eee1a31d98543e2595ccc1135
HEAD_REF master
PATCHES
fix-install.patch
allow-warnings.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
test BUILD_TESTING
test UNIFEX_BUILD_EXAMPLES
)

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
${FEATURE_OPTIONS}
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME unifex CONFIG_PATH lib/cmake/unifex)
vcpkg_copy_pdbs()

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()
29 changes: 29 additions & 0 deletions ports/libunifex/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "libunifex",
"version-date": "2021-08-01",
"description": "Unified Executors",
"homepage": "https://github.com/facebookexperimental/libunifex",
"supports": "linux | windows",
"dependencies": [
{
"name": "liburing",
"platform": "linux"
},
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"test": {
"description": "Build test/example programs",
"dependencies": [
"gtest"
]
}
}
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3684,6 +3684,10 @@
"baseline": "4.3-0",
"port-version": 0
},
"libunifex": {
"baseline": "2021-08-01",
"port-version": 0
},
"libunistring": {
"baseline": "0.9.10",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions versions/l-/libunifex.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "231324d6953ab65fd5778b171aa84b8132cb01f6",
"version-date": "2021-08-01",
"port-version": 0
}
]
}