diff options
| author | ruki <[email protected]> | 2021-02-19 00:32:29 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-02-19 00:32:29 +0800 |
| commit | 41e6c1d82e6417f8cc0818ae37ee2677fd3692c1 (patch) | |
| tree | 0090471be91de0b49e5fa81eb191f784d09bc088 | |
| parent | 16f8fb0248a252e185842ae2452975e6fd41aeb7 (diff) | |
improve export all
| -rw-r--r-- | tests/projects/c/shared_library_export_all/src/bar.cpp | 13 | ||||
| -rw-r--r-- | tests/projects/c/shared_library_export_all/xmake.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/core/tools/cparser.lua | 4 | ||||
| -rw-r--r-- | xmake/modules/core/tools/sdcc.lua | 4 | ||||
| -rw-r--r-- | xmake/modules/core/tools/tcc.lua | 4 | ||||
| -rw-r--r-- | xmake/rules/utils/symbols/export_all/export_all.lua | 2 |
6 files changed, 21 insertions, 8 deletions
diff --git a/tests/projects/c/shared_library_export_all/src/bar.cpp b/tests/projects/c/shared_library_export_all/src/bar.cpp new file mode 100644 index 000000000..9fdeca569 --- /dev/null +++ b/tests/projects/c/shared_library_export_all/src/bar.cpp @@ -0,0 +1,13 @@ +#include <stdio.h> + +class bar +{ + bar() {} + ~bar() {} + void test() {} +}; + +void test(bar& b) +{ + printf("test\n"); +} diff --git a/tests/projects/c/shared_library_export_all/xmake.lua b/tests/projects/c/shared_library_export_all/xmake.lua index f618fe2c9..4e3d86ef5 100644 --- a/tests/projects/c/shared_library_export_all/xmake.lua +++ b/tests/projects/c/shared_library_export_all/xmake.lua @@ -2,7 +2,7 @@ add_rules("mode.release", "mode.debug") target("foo") set_kind("shared") - add_files("src/foo.c") + add_files("src/foo.c", "src/bar.cpp") add_rules("utils.symbols.export_all") target("test") diff --git a/xmake/modules/core/tools/cparser.lua b/xmake/modules/core/tools/cparser.lua index a080268be..ed3c83a78 100644 --- a/xmake/modules/core/tools/cparser.lua +++ b/xmake/modules/core/tools/cparser.lua @@ -115,7 +115,7 @@ end -- make the includedir flag function nf_includedir(self, dir) - return {"-I", dir} + return {"-I" .. dir} end -- make the sysincludedir flag @@ -135,7 +135,7 @@ end -- make the linkdir flag function nf_linkdir(self, dir) - return {"-L", dir} + return {"-L" .. dir} end -- make the link arguments list diff --git a/xmake/modules/core/tools/sdcc.lua b/xmake/modules/core/tools/sdcc.lua index 351833b14..36445e79f 100644 --- a/xmake/modules/core/tools/sdcc.lua +++ b/xmake/modules/core/tools/sdcc.lua @@ -133,7 +133,7 @@ end -- make the includedir flag function nf_includedir(self, dir) - return {"-I", dir} + return {"-I" .. dir} end -- make the sysincludedir flag @@ -153,7 +153,7 @@ end -- make the linkdir flag function nf_linkdir(self, dir) - return {"-L", dir} + return {"-L" .. dir} end -- make the link arguments list diff --git a/xmake/modules/core/tools/tcc.lua b/xmake/modules/core/tools/tcc.lua index d9e18a795..d5400c994 100644 --- a/xmake/modules/core/tools/tcc.lua +++ b/xmake/modules/core/tools/tcc.lua @@ -97,7 +97,7 @@ end -- make the includedir flag function nf_includedir(self, dir) - return {"-I", dir} + return {"-I" .. dir} end -- make the sysincludedir flag @@ -117,7 +117,7 @@ end -- make the linkdir flag function nf_linkdir(self, dir) - return {"-L", dir} + return {"-L" .. dir} end -- make the link arguments list diff --git a/xmake/rules/utils/symbols/export_all/export_all.lua b/xmake/rules/utils/symbols/export_all/export_all.lua index ec6115142..52408957c 100644 --- a/xmake/rules/utils/symbols/export_all/export_all.lua +++ b/xmake/rules/utils/symbols/export_all/export_all.lua @@ -58,7 +58,7 @@ function main (target, opt) local symbol = line:match(".*External%s+| (.*)") if symbol then symbol = symbol:split('%s')[1] - if not symbol:startswith("__") then + if not symbol:startswith("__") and not symbol:startswith("?") then allsymbols:insert(symbol) end end |
