diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libcoro | |
Diffstat (limited to 'vcpkg/ports/libcoro')
| -rw-r--r-- | vcpkg/ports/libcoro/add-experimental-library.patch | 16 | ||||
| -rw-r--r-- | vcpkg/ports/libcoro/portfile.cmake | 37 | ||||
| -rw-r--r-- | vcpkg/ports/libcoro/vcpkg.json | 35 |
3 files changed, 88 insertions, 0 deletions
diff --git a/vcpkg/ports/libcoro/add-experimental-library.patch b/vcpkg/ports/libcoro/add-experimental-library.patch new file mode 100644 index 0000000..c2393f6 --- /dev/null +++ b/vcpkg/ports/libcoro/add-experimental-library.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a27a052..1a1e113 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,6 +14,11 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + link_libraries(-lc++) + endif() + ++# for C++20 std library (ex. std::stop_token) ++if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR ${CMAKE_SYSTEM_NAME} MATCHES "Android") ++ add_compile_options(-fexperimental-library) ++endif() ++ + if(UNIX AND NOT APPLE) + set(LINUX TRUE) + endif() diff --git a/vcpkg/ports/libcoro/portfile.cmake b/vcpkg/ports/libcoro/portfile.cmake new file mode 100644 index 0000000..2de24e0 --- /dev/null +++ b/vcpkg/ports/libcoro/portfile.cmake @@ -0,0 +1,37 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO jbaldwin/libcoro + REF "v${VERSION}" + SHA512 a975c75b7896cefa8ca3e07a81045ddfb29f7ba9fd069d4e8d37430428fe5ce222940c9d58fd549e53be5f92d3d30c7d0c27de1564f49fbc6fb4b866712624ec + HEAD_REF master + PATCHES + add-experimental-library.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + networking LIBCORO_FEATURE_NETWORKING + tls LIBCORO_FEATURE_TLS +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED_LIBS) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${FEATURE_OPTIONS} + -DLIBCORO_EXTERNAL_DEPENDENCIES=ON + -DLIBCORO_BUILD_TESTS=OFF + -DLIBCORO_BUILD_EXAMPLES=OFF + -DLIBCORO_BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} +) + +vcpkg_cmake_install() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") + +vcpkg_fixup_pkgconfig() + +vcpkg_copy_pdbs() diff --git a/vcpkg/ports/libcoro/vcpkg.json b/vcpkg/ports/libcoro/vcpkg.json new file mode 100644 index 0000000..505e46a --- /dev/null +++ b/vcpkg/ports/libcoro/vcpkg.json @@ -0,0 +1,35 @@ +{ + "name": "libcoro", + "version": "0.15.0", + "description": "C++20 coroutine library", + "homepage": "https://github.com/jbaldwin/libcoro", + "license": "Apache-2.0", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + } + ], + "features": { + "networking": { + "description": "Include networking features.", + "supports": "linux", + "dependencies": [ + "c-ares" + ] + }, + "tls": { + "description": "Include SSL features.", + "dependencies": [ + { + "name": "libcoro", + "default-features": false, + "features": [ + "networking" + ] + }, + "openssl" + ] + } + } +} |