diff options
| author | ruki <[email protected]> | 2022-03-02 22:45:53 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-03-02 22:45:53 +0800 |
| commit | 952611bf9f388d1f706f44daf557b580a1140c35 (patch) | |
| tree | 0497c956fb9d5ace246ff907e3b3587b817277dc | |
| parent | b68ec3a3564e6fa261a45e01c6d590d49219600f (diff) | |
improve export list
| -rw-r--r-- | xmake/rules/utils/symbols/export_list/xmake.lua | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/xmake/rules/utils/symbols/export_list/xmake.lua b/xmake/rules/utils/symbols/export_list/xmake.lua index a8fe2133a..874f9425e 100644 --- a/xmake/rules/utils/symbols/export_list/xmake.lua +++ b/xmake/rules/utils/symbols/export_list/xmake.lua @@ -32,8 +32,8 @@ rule("utils.symbols.export_list") target:add("shflags", "/def:" .. exportfile, {force = true}) elseif target:is_plat("macosx", "iphoneos", "watchos", "appletvos") then exportkind = "apple" - exportfile = path.join(target:autogendir(), "rules", "symbols", "export_list.txt") - target:add("shflags", {"-Wl,-exported_symbols_list", exportfile}, {force = true, expand = false}) + exportfile = path.join(target:autogendir(), "rules", "symbols", "export_list.exp") + target:add("shflags", {"-Wl,-exported_symbols_list", exportfile}, {force = true})--, expand = false}) elseif target:has_tool("ld", "gcc", "gxx", "clang", "clangxx") or target:has_tool("sh", "gcc", "gxx", "clang", "clangxx") then exportkind = "ver" @@ -58,7 +58,14 @@ rule("utils.symbols.export_list") *; };]]):format(table.concat(exportsymbols, ";\n ") .. ";")) elseif exportkind == "apple" then - io.writefile(exportfile, table.concat(exportsymbols, "\n")) + local file = io.open(exportfile, 'w') + for _, symbol in ipairs(exportsymbols) do + if not symbol:startswith("_") then + symbol = "_" .. symbol + end + file:print("%s", symbol) + end + file:close() elseif exportkind == "def" then local file = io.open(exportfile, 'w') file:print("EXPORTS") |
