From e22e69c851c611e5ab42d36e592534dc2e02ea92 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 12 Sep 2024 22:40:41 +0800 Subject: get sourcefile for export all --- tests/projects/c++/shared_library_export_all/xmake.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/projects/c++') diff --git a/tests/projects/c++/shared_library_export_all/xmake.lua b/tests/projects/c++/shared_library_export_all/xmake.lua index 33d2c7d0c..bc7b0dd68 100644 --- a/tests/projects/c++/shared_library_export_all/xmake.lua +++ b/tests/projects/c++/shared_library_export_all/xmake.lua @@ -9,8 +9,9 @@ target("bar") set_kind("shared") add_files("src/bar.cpp") add_rules("utils.symbols.export_all", {export_filter = function (symbol, opt) - local objectfile = opt.objectfile - if objectfile:find("bar.cpp", 1, true) and symbol:find("add", 1, true) then + 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}) -- cgit v1.3.1