summaryrefslogtreecommitdiff
path: root/xmake/templates/c++/module.shared/project/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-04-03 22:54:03 +0800
committerruki <[email protected]>2024-04-03 22:54:03 +0800
commitbefc1ba876323c2df0030b9828bcdfad93b4a092 (patch)
tree8f981b8539dd5c6712afd88569bf41724b8deeda /xmake/templates/c++/module.shared/project/xmake.lua
parentdb4196b069499e6fcf0d66c66a97665414c0011d (diff)
add module.shared template
Diffstat (limited to 'xmake/templates/c++/module.shared/project/xmake.lua')
-rw-r--r--xmake/templates/c++/module.shared/project/xmake.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/xmake/templates/c++/module.shared/project/xmake.lua b/xmake/templates/c++/module.shared/project/xmake.lua
new file mode 100644
index 000000000..34496aa5b
--- /dev/null
+++ b/xmake/templates/c++/module.shared/project/xmake.lua
@@ -0,0 +1,15 @@
+add_rules("mode.debug", "mode.release")
+
+add_moduledirs("modules")
+
+target("${TARGETNAME}")
+ 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}
+