Closed 01Pollux closed 2 weeks ago
If we pass sourcefile as path, the implementation is very complicated and it is not very accurate. This is because some rules automatically generate objectfiles and do not save the corresponding sourcefiles.
So I think it might be better and more accurate to pass objectfile as the path.
try this patch. https://github.com/xmake-io/xmake/pull/5608
target("bar")
set_kind("shared")
add_files("src/bar.cpp")
add_rules("utils.symbols.export_all", {export_filter = function (symbol, opt)
local filepath = opt.sourcefile or opt.objectfile
if filepath and filepath:find("bar.cpp", 1, true) and symbol:find("add", 1, true) then
print("export: %s at %s", symbol, filepath)
return true
end
end})
Is your feature request related to a problem? Please describe.
Currently, there is no way to know the file path from which a symbol was exported.
Describe the solution you'd like
It would be useful to have a way to export all symbols from files inside the 'Public/' directory, for example. The pseudocode could look like this:
Describe alternatives you've considered
No response
Additional context
No response