File tree Expand file tree Collapse file tree 3 files changed +43
-0
lines changed
Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ package (" mcpplibs-capi-lua" )
2+
3+ set_homepage (" https://github.com/mcpplibs/lua" )
4+ set_description (" C++23 module bindings for Lua 5.4 C API" )
5+ set_license (" Apache-2.0" )
6+
7+ add_urls (
8+ " https://github.com/mcpplibs/lua/archive/refs/tags/$(version).tar.gz" ,
9+ " https://github.com/mcpplibs/lua.git"
10+ )
11+
12+ add_versions (" 0.0.1" , " cd75cf95f193e782c9024e25a89fce99c820dc93930d7157a16f89f5a16b6521" )
13+
14+ add_deps (" lua" )
15+
16+ on_install (function (package )
17+ import (" package.tools.xmake" ).install (package )
18+ end )
Original file line number Diff line number Diff line change 1+ import std;
2+ import mcpplibs.capi.lua;
3+
4+ int main () {
5+ auto L = lua::L_newstate ();
6+ lua::L_openlibs (L);
7+
8+ lua::L_dostring (L, " result = 6 * 7" );
9+ lua::getglobal (L, " result" );
10+ auto result = lua::tointeger (L, -1 );
11+ std::println (" 6 * 7 = {}" , result);
12+
13+ lua::close (L);
14+ return 0 ;
15+ }
Original file line number Diff line number Diff line change 1+ add_repositories (" mcpplibs-index https://github.com/mcpplibs/mcpplibs-index.git" )
2+
3+ add_requires (" mcpplibs-capi-lua 0.0.1" )
4+
5+ target (" lua_test" )
6+ set_kind (" binary" )
7+ add_languages (" c++23" )
8+ add_files (" main.cpp" )
9+ add_packages (" mcpplibs-capi-lua" )
10+ set_policy (" build.c++.modules" , true )
You can’t perform that action at this time.
0 commit comments