summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-07-11 22:40:27 +0800
committerruki <[email protected]>2024-07-11 22:40:27 +0800
commit737b4fd7cd286d360f155df1ea68324aaa8b7317 (patch)
tree691947921338dd77bed3f71863e482b7a61dc26e
parentc90b483177dd45fb6e7a546b73fcd17c32bbaf23 (diff)
add symbols.depend
-rw-r--r--xmake/modules/utils/symbols/depend.lua38
1 files changed, 38 insertions, 0 deletions
diff --git a/xmake/modules/utils/symbols/depend.lua b/xmake/modules/utils/symbols/depend.lua
new file mode 100644
index 000000000..33cc821e5
--- /dev/null
+++ b/xmake/modules/utils/symbols/depend.lua
@@ -0,0 +1,38 @@
+--!A cross-platform build utility based on Lua
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+-- Copyright (C) 2015-present, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file depend.lua
+--
+
+-- imports
+import("core.base.option")
+import("lib.detect.find_tool")
+
+function _get_all_depends_by_dumpbin(binaryfile, opt)
+ local dumpbin = find_tool("dumpbin")
+ if dumpbin then
+ local depends = try { function () return os.iorunv(dumpbin.program, {"/dependent", "/nologo", objectfile}) end }
+ end
+end
+
+function main(binaryfile, opt)
+ local depends
+ if is_host("windows") then
+ depends = _get_all_depends_by_dumpbin(binaryfile, opt)
+ end
+ return depends
+end