summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-04-03 23:34:46 +0800
committerruki <[email protected]>2024-04-03 23:34:46 +0800
commit817353b79fc9145c18992facd920ec8f9497000b (patch)
treefe3b2423ff3dab6665163d024e933a4fd3531076
parent5ae6718ca77480542aef533ea90f799e05c46aec (diff)
add zoo module
-rw-r--r--tests/projects/other/native_module/modules/shared/zoo/src/zoo.c12
-rw-r--r--tests/projects/other/native_module/modules/shared/zoo/xmake.lua6
-rw-r--r--tests/projects/other/native_module/xmake.lua11
3 files changed, 25 insertions, 4 deletions
diff --git a/tests/projects/other/native_module/modules/shared/zoo/src/zoo.c b/tests/projects/other/native_module/modules/shared/zoo/src/zoo.c
new file mode 100644
index 000000000..b9bf90ec5
--- /dev/null
+++ b/tests/projects/other/native_module/modules/shared/zoo/src/zoo.c
@@ -0,0 +1,12 @@
+#include <stdlib.h>
+
+int add(int a, int b) {
+ return a + b;
+}
+
+int sub(int a, int b) {
+ return a + b;
+}
+
+void module_zoo() {
+}
diff --git a/tests/projects/other/native_module/modules/shared/zoo/xmake.lua b/tests/projects/other/native_module/modules/shared/zoo/xmake.lua
new file mode 100644
index 000000000..a74c73637
--- /dev/null
+++ b/tests/projects/other/native_module/modules/shared/zoo/xmake.lua
@@ -0,0 +1,6 @@
+add_rules("mode.debug", "mode.release")
+
+target("zoo")
+ add_rules("module.shared")
+ add_files("src/zoo.c")
+
diff --git a/tests/projects/other/native_module/xmake.lua b/tests/projects/other/native_module/xmake.lua
index e403454bb..3148fc0f2 100644
--- a/tests/projects/other/native_module/xmake.lua
+++ b/tests/projects/other/native_module/xmake.lua
@@ -7,10 +7,13 @@ target("test")
add_files("src/*.cpp")
on_config(function (target)
import("shared.foo")
+ import("shared.zoo")
import("binary.bar", {always_build = true})
- print("shared: 1 + 1 = %d", foo.add(1, 1))
- print("shared: 1 - 1 = %d", foo.sub(1, 1))
- print("binary: 1 + 1 = %s", bar.add(1, 1))
- print("binary: 1 - 1 = %s", bar.sub(1, 1))
+ print("foo: 1 + 1 = %d", foo.add(1, 1))
+ print("foo: 1 - 1 = %d", foo.sub(1, 1))
+ print("zoo: 1 + 1 = %d", zoo.add(1, 1))
+ print("zoo: 1 - 1 = %d", zoo.sub(1, 1))
+ print("bar: 1 + 1 = %s", bar.add(1, 1))
+ print("bar: 1 - 1 = %s", bar.sub(1, 1))
end)