diff options
| author | ruki <[email protected]> | 2024-09-12 13:48:40 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-09-12 13:48:40 +0800 |
| commit | cb905957b80e9cfd8fbdd2bced9a1e7331041a87 (patch) | |
| tree | 9adf22c41a512d2f4ebab0e7514a0fcae72e1c3c /tests | |
| parent | fa48b0f9caa3472252485d7c2514c4456935d2b3 (diff) | |
| parent | b3fa6a33fec098c147e3d978f010f12df5e994f6 (diff) | |
Merge pull request #5608 from xmake-io/exportall
Improve export all rule
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/projects/c++/shared_library_export_all/xmake.lua | 7 |
1 files changed, 5 insertions, 2 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..bc7b0dd68 100644 --- a/tests/projects/c++/shared_library_export_all/xmake.lua +++ b/tests/projects/c++/shared_library_export_all/xmake.lua @@ -8,8 +8,10 @@ target("foo") target("bar") set_kind("shared") add_files("src/bar.cpp") - add_rules("utils.symbols.export_all", {export_filter = function (symbol) - if symbol:find("add", 1, true) then + 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}) @@ -20,3 +22,4 @@ target("demo") add_files("src/main.cpp") + |
