Skip to content

Commit

Permalink
improve symbols for clang
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Nov 4, 2022
1 parent d0fc528 commit e72b3d1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions xmake/rules/c++/modules/modules_support/clang.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,22 @@ function load(target)
target:add("cxxflags", builtinmodulemapflag, {force = true})
target:add("cxxflags", implicitmodulesflag, {force = true})

-- TODO fix default visibility for functions and variables [-fvisibility] differs in PCH file vs. current file
-- 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.
target:set("symbols", "none")
local dep_symbols
local has_shared_deps = false
for _, dep in ipairs(target:orderdeps()) do
if dep:is_shared() then
dep_symbols = dep:get("symbols")
has_shared_deps = true
break
end
end
if has_shared_deps then
target:set("symbols", dep_symbols and dep_symbols or "none")
end

-- if use libc++, we need install libc++ and libc++abi
--
Expand Down

0 comments on commit e72b3d1

Please sign in to comment.