summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-02-16 23:30:58 +0800
committerruki <[email protected]>2023-02-16 23:30:58 +0800
commit44053082b5aa4765d9b6a10322a1ad8fc253a762 (patch)
treead6a2b6a811dfa1277fe651d016030a6c9f37618
parent3761c27bb3fa4ee92f73662e1bb9979fcc83f87a (diff)
fix visibility differs
-rw-r--r--xmake/rules/c++/modules/modules_support/clang.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/xmake/rules/c++/modules/modules_support/clang.lua b/xmake/rules/c++/modules/modules_support/clang.lua
index 6766fae1a..71127da77 100644
--- a/xmake/rules/c++/modules/modules_support/clang.lua
+++ b/xmake/rules/c++/modules/modules_support/clang.lua
@@ -139,17 +139,19 @@ function load(target)
-- fix default visibility for functions and variables [-fvisibility] differs in PCH file vs. current file
-- module.pcm cannot be loaded due to a configuration mismatch with the current compilation.
--
- -- it will happen in binary target depend ont shared target with modules, and enable release mode at same time.
+ -- it will happen in binary target depend on library target with modules, and enable release mode at same time.
+ --
+ -- @see https://github.com/xmake-io/xmake/issues/3358#issuecomment-1432586767
local dep_symbols
- local has_shared_deps = false
+ local has_library_deps = false
for _, dep in ipairs(target:orderdeps()) do
- if dep:is_shared() then
+ if dep:is_shared() or dep:is_static() or dep:is_object() then
dep_symbols = dep:get("symbols")
- has_shared_deps = true
+ has_library_deps = true
break
end
end
- if has_shared_deps then
+ if has_library_deps then
target:set("symbols", dep_symbols and dep_symbols or "none")
end