summaryrefslogtreecommitdiff
path: root/xmake/templates/c++/module/shared
diff options
context:
space:
mode:
authorruki <[email protected]>2026-03-04 00:40:11 +0800
committerruki <[email protected]>2026-03-04 00:40:11 +0800
commit078b2ee0b6087a70bae05d3fa86d01078786513c (patch)
tree6f28e600fd9dcfb11bebb7abf02d36ebf1b7a685 /xmake/templates/c++/module/shared
parente0e20ef6ddbd0fc62fbaa00d195ce95f22a86fdf (diff)
move templates to repository
Diffstat (limited to 'xmake/templates/c++/module/shared')
-rw-r--r--xmake/templates/c++/module/shared/.gitignore8
-rw-r--r--xmake/templates/c++/module/shared/modules/shared/foo/src/foo.cpp22
-rw-r--r--xmake/templates/c++/module/shared/modules/shared/foo/xmake.lua6
-rw-r--r--xmake/templates/c++/module/shared/src/main.cpp6
-rw-r--r--xmake/templates/c++/module/shared/xmake.lua15
5 files changed, 0 insertions, 57 deletions
diff --git a/xmake/templates/c++/module/shared/.gitignore b/xmake/templates/c++/module/shared/.gitignore
deleted file mode 100644
index 152105761..000000000
--- a/xmake/templates/c++/module/shared/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# Xmake cache
-.xmake/
-build/
-
-# MacOS Cache
-.DS_Store
-
-
diff --git a/xmake/templates/c++/module/shared/modules/shared/foo/src/foo.cpp b/xmake/templates/c++/module/shared/modules/shared/foo/src/foo.cpp
deleted file mode 100644
index adde214ca..000000000
--- a/xmake/templates/c++/module/shared/modules/shared/foo/src/foo.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <xmi.h>
-
-static int add(lua_State *lua) {
- int a = lua_tointeger(lua, 1);
- int b = lua_tointeger(lua, 2);
- lua_pushinteger(lua, a + b);
- return 1;
-}
-
-static int sub(lua_State *lua) {
- int a = lua_tointeger(lua, 1);
- int b = lua_tointeger(lua, 2);
- lua_pushinteger(lua, a - b);
- return 1;
-}
-
-int luaopen(foo, lua_State *lua) {
- static const luaL_Reg funcs[] = { { "add", add }, { "sub", sub }, { NULL, NULL } };
- lua_newtable(lua);
- luaL_setfuncs(lua, funcs, 0);
- return 1;
-}
diff --git a/xmake/templates/c++/module/shared/modules/shared/foo/xmake.lua b/xmake/templates/c++/module/shared/modules/shared/foo/xmake.lua
deleted file mode 100644
index 9b3423d41..000000000
--- a/xmake/templates/c++/module/shared/modules/shared/foo/xmake.lua
+++ /dev/null
@@ -1,6 +0,0 @@
-add_rules("mode.debug", "mode.release")
-
-target("foo")
- add_rules("module.shared")
- add_files("src/foo.cpp")
-
diff --git a/xmake/templates/c++/module/shared/src/main.cpp b/xmake/templates/c++/module/shared/src/main.cpp
deleted file mode 100644
index 9b6abffea..000000000
--- a/xmake/templates/c++/module/shared/src/main.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <iostream>
-
-int main(int argc, char **argv) {
- std::cout << "hello world!" << std::endl;
- return 0;
-}
diff --git a/xmake/templates/c++/module/shared/xmake.lua b/xmake/templates/c++/module/shared/xmake.lua
deleted file mode 100644
index 43aafe904..000000000
--- a/xmake/templates/c++/module/shared/xmake.lua
+++ /dev/null
@@ -1,15 +0,0 @@
-add_rules("mode.debug", "mode.release")
-
-add_moduledirs("modules")
-
-target("${TARGET_NAME}")
- set_kind("binary")
- add_files("src/*.cpp")
- on_config(function (target)
- import("shared.foo")
- print("shared: 1 + 1 = %s", foo.add(1, 1))
- print("shared: 1 - 1 = %s", foo.sub(1, 1))
- end)
-
-${FAQ}
-