Skip to content

Commit 48afdad

Browse files
authored
[ucoro] add new port (microsoft#42969)
1 parent 3fb4357 commit 48afdad

File tree

5 files changed

+92
-0
lines changed

5 files changed

+92
-0
lines changed

ports/ucoro/cmake-install.patch

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 663044e..9121cb3 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -15,8 +15,31 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
6+
add_compile_options(-foptimize-sibling-calls)
7+
endif()
8+
9+
+include(GNUInstallDirs)
10+
+
11+
add_library(ucoro INTERFACE)
12+
-target_include_directories(ucoro INTERFACE include)
13+
+target_include_directories(ucoro INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
14+
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
15+
+
16+
+option(UCORO_BUILD_TESTING "Build the tests" ON)
17+
+if (UCORO_BUILD_TESTING)
18+
+ enable_testing()
19+
+ add_subdirectory(tests)
20+
+endif()
21+
22+
-enable_testing()
23+
-add_subdirectory(tests)
24+
+install(
25+
+ TARGETS ucoro
26+
+ EXPORT ucoroTargets
27+
+ INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
28+
+)
29+
+install(
30+
+ DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ucoro
31+
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
32+
+)
33+
+# generate config.cmake
34+
+install(
35+
+ EXPORT ucoroTargets
36+
+ FILE ucoro-config.cmake
37+
+ NAMESPACE ucoro::
38+
+ DESTINATION "share/ucoro"
39+
+)

ports/ucoro/portfile.cmake

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
set(VCPKG_BUILD_TYPE release) # header-only
2+
3+
vcpkg_from_github(
4+
OUT_SOURCE_PATH SOURCE_PATH
5+
REPO avplayer/ucoro
6+
REF "v${VERSION}"
7+
SHA512 c3436b436ef1ebb3d47a65db9603842293bdb6451bc6fb738a63d61a63b52901e223f46625d956303566dc52dfb38ffb2c6ce20016c18b444f9cb3e2e701e613
8+
HEAD_REF main
9+
PATCHES
10+
cmake-install.patch
11+
)
12+
13+
vcpkg_cmake_configure(
14+
SOURCE_PATH "${SOURCE_PATH}"
15+
OPTIONS
16+
-DUCORO_BUILD_TESTING=OFF
17+
)
18+
19+
vcpkg_cmake_install()
20+
vcpkg_cmake_config_fixup()
21+
vcpkg_fixup_pkgconfig()
22+
23+
file(INSTALL "${SOURCE_PATH}/LICENSE_1_0.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

ports/ucoro/vcpkg.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "ucoro",
3+
"version": "1.0",
4+
"description": "It is a minimized C++20 coroutine library.",
5+
"homepage": "https://github.com/avplayer/ucoro",
6+
"license": "BSL-1.0",
7+
"dependencies": [
8+
{
9+
"name": "vcpkg-cmake",
10+
"host": true
11+
},
12+
{
13+
"name": "vcpkg-cmake-config",
14+
"host": true
15+
}
16+
]
17+
}

versions/baseline.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9208,6 +9208,10 @@
92089208
"baseline": "0.0.8",
92099209
"port-version": 0
92109210
},
9211+
"ucoro": {
9212+
"baseline": "1.0",
9213+
"port-version": 0
9214+
},
92119215
"udt": {
92129216
"baseline": "4.11",
92139217
"port-version": 0

versions/u-/ucoro.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"versions": [
3+
{
4+
"git-tree": "29380e4860b67d864c58e5c7b26c763dd90b634b",
5+
"version": "1.0",
6+
"port-version": 0
7+
}
8+
]
9+
}

0 commit comments

Comments
 (0)