diff options
| author | ririyeye <[email protected]> | 2024-09-02 14:55:06 +0800 |
|---|---|---|
| committer | ririyeye <[email protected]> | 2024-09-02 14:55:06 +0800 |
| commit | 5b6a3a3d52ac17ddb01840c8d1d9c7da7d73c2a5 (patch) | |
| tree | 3617e776856669253c91dec9b1f2115aeb77f6e4 | |
| parent | 6cad7300ea2de380863c1f46e896a372b74d84a7 (diff) | |
swig fix include err , fix par err
| -rw-r--r-- | tests/projects/swig/java_c/src/example.i | 4 | ||||
| -rw-r--r-- | tests/projects/swig/java_c/src/example2.i | 2 | ||||
| -rw-r--r-- | tests/projects/swig/java_c/xmake.lua | 1 | ||||
| -rw-r--r-- | xmake/rules/swig/build_module_file.lua | 12 |
4 files changed, 12 insertions, 7 deletions
diff --git a/tests/projects/swig/java_c/src/example.i b/tests/projects/swig/java_c/src/example.i index 1228cb6a9..6bac9f7a3 100644 --- a/tests/projects/swig/java_c/src/example.i +++ b/tests/projects/swig/java_c/src/example.i @@ -4,8 +4,4 @@ extern int fact(int n); %} extern int fact(int n); - - - - %include "example2.i" diff --git a/tests/projects/swig/java_c/src/example2.i b/tests/projects/swig/java_c/src/example2.i index a486c354a..794af702d 100644 --- a/tests/projects/swig/java_c/src/example2.i +++ b/tests/projects/swig/java_c/src/example2.i @@ -1,5 +1,3 @@ - - %inline %{ #include "test.h" %} diff --git a/tests/projects/swig/java_c/xmake.lua b/tests/projects/swig/java_c/xmake.lua index c1dfccf0d..3108859a7 100644 --- a/tests/projects/swig/java_c/xmake.lua +++ b/tests/projects/swig/java_c/xmake.lua @@ -17,6 +17,7 @@ target("example") "build/java/com/example/" }}) add_files("src/example.c") + add_includedirs("src") before_build(function() -- ensure output path exists before running swig os.mkdir("build/java/com/example/") diff --git a/xmake/rules/swig/build_module_file.lua b/xmake/rules/swig/build_module_file.lua index 451e65d40..ae48e1350 100644 --- a/xmake/rules/swig/build_module_file.lua +++ b/xmake/rules/swig/build_module_file.lua @@ -119,7 +119,13 @@ function swig_par(target, sourcefile, opt) end table.insert(argv, sourcefile) - return { argv = argv , objectfile = objectfile , swig = swig , sourcefile_cx = sourcefile_cx} + return { argv = argv + , objectfile = objectfile + , swig = swig + , sourcefile_cx = sourcefile_cx + , moduletype = moduletype + , fileconfig = fileconfig + } end function swig_build_cmd(target, batchcmds, sourcefile, opt, pars) @@ -129,6 +135,8 @@ function swig_build_cmd(target, batchcmds, sourcefile, opt, pars) local argv = par.argv local swig = par.swig local sourcefile_cx = par.sourcefile_cx + local moduletype = par.moduletype + local fileconfig = par.fileconfig batchcmds:show_progress(opt.progress, "${color.build.object}compiling.swig.%s %s", moduletype, sourcefile) batchcmds:mkdir(path.directory(sourcefile_cx)) @@ -149,6 +157,8 @@ function swig_build_file(target, sourcefile, opt, par) local argv = par.argv local swig = par.swig local sourcefile_cx = par.sourcefile_cx + local moduletype = par.moduletype + local fileconfig = par.fileconfig local dependfile = target:dependfile(objectfile) local dependinfo = target:is_rebuilt() and {} or (depend.load(dependfile) or {}) |
