summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/core/tools/gcc.lua10
1 files changed, 2 insertions, 8 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 2c4a5a0a3..205921400 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -41,17 +41,11 @@ function init(self)
, "-DIBAction=void)__attribute__((ibaction)"}
-- init shflags
- _g.shflags = { "-shared" }
+ _g.shflags = { "-shared", "-fPIC" }
-- init cxflags for the kind: shared
_g.shared = {}
- _g.shared.cxflags = {}
-
- -- add -fPIC (need not it on mingw/windows)
- if self:has_flags("-fPIC") then
- table.insert(_g.shflags, "-fPIC")
- table.insert(_g.shared.cxflags, "-fPIC")
- end
+ _g.shared.cxflags = {"-fPIC"}
-- suppress warning for clang (gcc -> clang on macosx)
if self:has_flags("-Qunused-arguments") then