summaryrefslogtreecommitdiff
path: root/xmake/rules/swig/xmake.lua
diff options
context:
space:
mode:
authorririyeye <[email protected]>2024-08-29 15:02:58 +0800
committerririyeye <[email protected]>2024-08-29 15:02:58 +0800
commitebc9ffe55beac2b7f8a284e51990612d61e4d1b7 (patch)
tree966837d5d4ceab4621c693852cca756b62f1a3ab /xmake/rules/swig/xmake.lua
parent2a2ee54fe65cd4035bc25b01391e63170c952c38 (diff)
build jar in swig mode
Diffstat (limited to 'xmake/rules/swig/xmake.lua')
-rw-r--r--xmake/rules/swig/xmake.lua15
1 files changed, 10 insertions, 5 deletions
diff --git a/xmake/rules/swig/xmake.lua b/xmake/rules/swig/xmake.lua
index 05db9a3a1..daa273231 100644
--- a/xmake/rules/swig/xmake.lua
+++ b/xmake/rules/swig/xmake.lua
@@ -81,7 +81,12 @@ rule("swig.base")
elseif moduletype == "lua" then
autogenfiles = os.files(path.join(autogendir, "*.lua"))
elseif moduletype == "java" then
- autogenfiles = os.files(path.join(autogendir, "*.java"))
+ local buildjar = target:extraconf("rules", "swig.c", "buildjar") or target:extraconf("rules", "swig.cpp", "buildjar")
+ if buildjar then
+ autogenfiles = path.join(autogendir , target:name()..".jar")
+ else
+ autogenfiles = os.files(path.join(autogendir, "*.java"))
+ end
end
if autogenfiles then
table.join2(scriptfiles, autogenfiles)
@@ -100,15 +105,15 @@ rule("swig.base")
rule("swig.c")
set_extensions(".i")
add_deps("swig.base", "c.build")
- on_buildcmd_file(function (target, batchcmds, sourcefile, opt)
- import("build_module_file")(target, batchcmds, sourcefile, table.join({sourcekind = "cc"}, opt))
+ on_build_file(function (target, sourcefile, opt)
+ import("build_module_file")(target, sourcefile, table.join({sourcekind = "cc"}, opt))
end)
rule("swig.cpp")
set_extensions(".i")
add_deps("swig.base", "c++.build")
- on_buildcmd_file(function (target, batchcmds, sourcefile, opt)
- import("build_module_file")(target, batchcmds, sourcefile, table.join({sourcekind = "cxx"}, opt))
+ on_build_file(function (target, sourcefile, opt)
+ import("build_module_file")(target, sourcefile, table.join({sourcekind = "cxx"}, opt))
end)