summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-02-08 00:29:04 +0800
committerruki <[email protected]>2024-02-08 00:29:04 +0800
commitbd3e33545598f5c8647668f48d7e35c7cf9a3ec0 (patch)
treedaca4287c84751112de29964160dd417b7b8ad64
parent76558d21fd3277f5f8d7c43c69d0b24f68ca4acd (diff)
improve export_all for clang #4719
-rw-r--r--xmake/rules/utils/symbols/export_all/xmake.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/rules/utils/symbols/export_all/xmake.lua b/xmake/rules/utils/symbols/export_all/xmake.lua
index b64f41bf4..0a1f1c2a9 100644
--- a/xmake/rules/utils/symbols/export_all/xmake.lua
+++ b/xmake/rules/utils/symbols/export_all/xmake.lua
@@ -32,7 +32,11 @@ rule("utils.symbols.export_all")
if target:is_plat("windows") then
assert(target:get("optimize") ~= "smallest", 'rule("utils.symbols.export_all"): does not support set_optimize("smallest") for target(%s)!', target:name())
local allsymbols_filepath = path.join(target:autogendir(), "rules", "symbols", "export_all.def")
- target:add("shflags", "/def:" .. allsymbols_filepath, {force = true})
+ if target:has_tool("sh", "link") then
+ target:add("shflags", "/def:" .. allsymbols_filepath, {force = true})
+ elseif target:has_tool("sh", "clang", "clangxx") then
+ target:add("shflags", "-Wl,/def:" .. allsymbols_filepath, {force = true})
+ end
end
end)
before_link("export_all")