diff --git a/ports/libunifex/allow-warnings.patch b/ports/libunifex/allow-warnings.patch new file mode 100644 index 00000000000000..272624f0667c16 --- /dev/null +++ b/ports/libunifex/allow-warnings.patch @@ -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() diff --git a/ports/libunifex/fix-install.patch b/ports/libunifex/fix-install.patch new file mode 100644 index 00000000000000..2b454c49c19a6c --- /dev/null +++ b/ports/libunifex/fix-install.patch @@ -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 + $ +- "${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 ++) diff --git a/ports/libunifex/portfile.cmake b/ports/libunifex/portfile.cmake new file mode 100644 index 00000000000000..f7379fc20c4d18 --- /dev/null +++ b/ports/libunifex/portfile.cmake @@ -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() diff --git a/ports/libunifex/vcpkg.json b/ports/libunifex/vcpkg.json new file mode 100644 index 00000000000000..c42782e1c0bff9 --- /dev/null +++ b/ports/libunifex/vcpkg.json @@ -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" + ] + } + } +} diff --git a/versions/baseline.json b/versions/baseline.json index ae0396a56267b4..e734bce053091f 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -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 diff --git a/versions/l-/libunifex.json b/versions/l-/libunifex.json new file mode 100644 index 00000000000000..621c7b834c04e6 --- /dev/null +++ b/versions/l-/libunifex.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "150573588108677bf5bbcb832d1249bd73f76e36", + "version-date": "2021-08-01", + "port-version": 0 + } + ] +}