diff options
| author | ruki <[email protected]> | 2021-06-19 00:44:07 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-06-19 00:44:07 +0800 |
| commit | e3e9c9a4cabe1fd164f5f8ad79e90d2e9e391437 (patch) | |
| tree | 28e59298a52a80149d1e80a4b8cc18371176c468 /xmake/rules/utils | |
| parent | abcb36d06cf324c64968606950ec7c586dbafa61 (diff) | |
export c++ classes
Diffstat (limited to 'xmake/rules/utils')
| -rw-r--r-- | xmake/rules/utils/symbols/export_all/export_all.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/xmake/rules/utils/symbols/export_all/export_all.lua b/xmake/rules/utils/symbols/export_all/export_all.lua index 54fe738ea..83f92eb2a 100644 --- a/xmake/rules/utils/symbols/export_all/export_all.lua +++ b/xmake/rules/utils/symbols/export_all/export_all.lua @@ -47,6 +47,9 @@ function main (target, opt) local msvc = toolchain.load("msvc", {plat = target:plat(), arch = target:arch()}) local dumpbin = assert(find_tool("dumpbin", {envs = msvc:runenvs()}), "dumpbin not found!") + -- export with c++ class? + local export_with_classes = target:extraconf("rules", "utils.symbols.export_all", "with_classes") + -- get all symbols from object files local allsymbols = hashset.new() for _, objectfile in ipairs(target:objectfiles()) do @@ -58,11 +61,13 @@ function main (target, opt) local symbol = line:match(".*External%s+| (.*)") if symbol then symbol = symbol:split('%s')[1] - if not symbol:startswith("__") and not symbol:startswith("?") then + if not symbol:startswith("__") then if target:is_arch("x86") and symbol:startswith("_") then symbol = symbol:sub(2) end - allsymbols:insert(symbol) + if export_with_classes or not symbol:startswith("?") then + allsymbols:insert(symbol) + end end end end |
