From 2e996cf451b107c5e9317d740b0ddff19cc83c24 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 3 Apr 2020 23:33:30 +0800 Subject: fix nf_symbol --- xmake/modules/core/tools/gcc.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 6e96e03f3..c5af92e8e 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -90,7 +90,8 @@ end -- make the symbol flag function nf_symbol(self, level) -- only for source kind - if language.sourcekinds()[self:kind()] then + local kind = self:kind() + if language.sourcekinds()[kind] then local maps = _g.symbol_maps if not maps then maps = @@ -98,12 +99,12 @@ function nf_symbol(self, level) debug = "-g" , hidden = "-fvisibility=hidden" } - if self:has_flags("-fvisibility-inlines-hidden", "cxflags") then - maps.hidden = {maps.hidden, "-fvisibility-inlines-hidden"} + if kind == "cxx" and self:has_flags("-fvisibility-inlines-hidden", "cxflags") then + maps.hidden_cxx = {"-fvisibility=hidden", "-fvisibility-inlines-hidden"} end _g.symbol_maps = maps end - return maps[level] + return maps[level .. '_' .. kind] or maps[level] end end -- cgit v1.3.1