diff options
| -rw-r--r-- | xmake/rules/swig/xmake.lua | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/xmake/rules/swig/xmake.lua b/xmake/rules/swig/xmake.lua index 00ef16afa..05db9a3a1 100644 --- a/xmake/rules/swig/xmake.lua +++ b/xmake/rules/swig/xmake.lua @@ -74,17 +74,20 @@ rule("swig.base") if fileconfig then scriptdir = fileconfig.scriptdir end - local scriptfile = path.join(target:autogendir(), "rules", "swig", path.basename(sourcefile)) + local autogenfiles + local autogendir = path.join(target:autogendir(), "rules", "swig") if moduletype == "python" then - scriptfile = scriptfile .. ".py" + autogenfiles = os.files(path.join(autogendir, "*.py")) elseif moduletype == "lua" then - scriptfile = scriptfile .. ".lua" + autogenfiles = os.files(path.join(autogendir, "*.lua")) elseif moduletype == "java" then - scriptfile = scriptfile .. ".java" + autogenfiles = os.files(path.join(autogendir, "*.java")) end - table.insert(scriptfiles, scriptfile) - if scriptdir then - target:add("installfiles", scriptfile, {prefixdir = scriptdir}) + if autogenfiles then + table.join2(scriptfiles, autogenfiles) + if scriptdir then + target:add("installfiles", autogenfiles, {prefixdir = scriptdir}) + end end end end |
