Skip to content

Commit 33c96a5

Browse files
committed
add templates lib
1 parent dccb526 commit 33c96a5

File tree

5 files changed

+57
-0
lines changed

5 files changed

+57
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.xmake
2+
build

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,21 @@
11
# mcpplibs-index
2+
23
mcpplibs index
4+
5+
## How to use?
6+
7+
```lua
8+
-- 0 - Add mcpplibs's index repos
9+
add_repositories("mcpplibs-index git@github.com:mcpplibs/mcpplibs-index.git")
10+
11+
-- 1 - Add the libraries and versions you need
12+
add_requires("mcpplibs-index@templates 0.0.1")
13+
14+
target("templates_test")
15+
set_kind("binary")
16+
set_languages("c++23")
17+
add_files("main.cpp")
18+
-- 2 - Use it
19+
add_packages("mcpplibs-index@templates")
20+
set_policy("build.c++.modules", true)
21+
```

packages/t/templates/xmake.lua

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package("templates")
2+
3+
--set_kind("library", {headeronly = true})
4+
5+
set_homepage("https://github.com/mcpplibs/templates")
6+
set_description("A template of modern C++ `modules` libraries")
7+
set_license("Apache-2.0")
8+
9+
add_urls(
10+
-- https://github.com/mcpplibs/templates/archive/refs/tags/0.0.1.tar.gz
11+
"https://github.com/mcpplibs/templates/archive/refs/tags/$(version).tar.gz",
12+
"https://github.com/mcpplibs/templates.git"
13+
)
14+
15+
add_versions("0.0.1", "f0833b18f9919ee187b8c63f8a47d1eb71382cb662805529a5e6ce1804b5335a")
16+
17+
on_install(function (package)
18+
import("package.tools.xmake").install(package)
19+
end)

tests/t/templates/main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// more-details: https://github.com/mcpplibs/templates
2+
import mcpplibs.templates;
3+
4+
auto main() -> int {
5+
mcpplibs::hello_mcpp();
6+
}

tests/t/templates/xmake.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
add_repositories("mcpplibs-index git@github.com:mcpplibs/mcpplibs-index.git")
2+
3+
add_requires("templates 0.0.1")
4+
--add_requires("mcpplibs-index::templates 0.0.1") -- TODO: impl prefix support in xmake
5+
6+
target("templates_test")
7+
set_kind("binary")
8+
set_languages("c++23")
9+
add_files("main.cpp")
10+
add_packages("templates")
11+
set_policy("build.c++.modules", true)

0 commit comments

Comments
 (0)