From e962066eca9967087a9a4495cf6a82fb2b4bd367 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 12 Sep 2024 22:36:09 +0800 Subject: improve export all #5601 --- tests/projects/c++/shared_library_export_all/xmake.lua | 2 +- xmake/rules/utils/symbols/export_all/export_all.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/projects/c++/shared_library_export_all/xmake.lua b/tests/projects/c++/shared_library_export_all/xmake.lua index 73159d4b5..50043a52a 100644 --- a/tests/projects/c++/shared_library_export_all/xmake.lua +++ b/tests/projects/c++/shared_library_export_all/xmake.lua @@ -8,7 +8,7 @@ target("foo") target("bar") set_kind("shared") add_files("src/bar.cpp") - add_rules("utils.symbols.export_all", {export_filter = function (symbol) + add_rules("utils.symbols.export_all", {export_filter = function (symbol, opt) if symbol:find("add", 1, true) then return true end diff --git a/xmake/rules/utils/symbols/export_all/export_all.lua b/xmake/rules/utils/symbols/export_all/export_all.lua index 1c2806b79..0101bcfa5 100644 --- a/xmake/rules/utils/symbols/export_all/export_all.lua +++ b/xmake/rules/utils/symbols/export_all/export_all.lua @@ -47,7 +47,7 @@ function _get_allsymbols_by_dumpbin(target, dumpbin, opt) symbol = symbol:sub(2) end if export_filter then - if export_filter(symbol) then + if export_filter(symbol, {objectfile = objectfile}) then allsymbols:insert(symbol) end elseif not symbol:startswith("__") then @@ -88,7 +88,7 @@ function _get_allsymbols_by_objdump(target, objdump, opt) symbol = symbol:sub(2) end if export_filter then - if export_filter(symbol) then + if export_filter(symbol, {objectfile = objectfile}) then allsymbols:insert(symbol) end elseif not symbol:startswith("__") then -- cgit v1.3.1