Skip to content

Commit

Permalink
[libunifex] create a new port (#19279)
Browse files Browse the repository at this point in the history
* [libunifex] create a new port

* [libunifex] update version/baseline

* [libunifex] fix wrong support expression

* update version SHA

* [libunifex] more warning comments

* [libunifex] use `unofficial::` namespace

* [libunifex] allow warnings in build

* simplify the patch file

* Update ports/libunifex/vcpkg.json

Co-authored-by: ras0219 <[email protected]>

* [libunifex] update patch files

* [libunifex] replace INCLUDEDIR to include

Co-authored-by: ras0219 <[email protected]>
  • Loading branch information
luncliff and ras0219 authored Aug 30, 2021
1 parent 8602e5f commit 047e8ef
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 0 deletions.
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>
+ $<INSTALL_INTERFACE: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": "!osx",
"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 @@ -3724,6 +3724,10 @@
"baseline": "4.3-0",
"port-version": 0
},
"libunifex": {
"baseline": "2021-08-01",
"port-version": 0
},
"libunistring": {
"baseline": "0.9.10",
"port-version": 1
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": "150573588108677bf5bbcb832d1249bd73f76e36",
"version-date": "2021-08-01",
"port-version": 0
}
]
}

0 comments on commit 047e8ef

Please sign in to comment.