diff options
| author | ruki <[email protected]> | 2023-11-23 09:22:50 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-11-23 09:22:50 +0800 |
| commit | 401d67ca9824632d1531889a6261f458fa161c4c (patch) | |
| tree | 7c8edf5956969629d792ff962ca8aa7885fd4103 | |
| parent | f4bb23694823dd5772dd310022a5f04a9182c25f (diff) | |
| parent | 3789e2356dbd995c6e7952b05f666002d1a8c5ac (diff) | |
Merge pull request #4413 from ririyeye/master
swig may generate multi files
| -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 |
