summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/gcc.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-11-02 00:39:57 +0800
committerruki <[email protected]>2021-11-02 00:39:57 +0800
commit1c667ecedce4a2f90f32787f7f667f967421ec1f (patch)
tree38951721fdcd227a14be05d936663300731dc62a /xmake/modules/core/tools/gcc.lua
parentbef276b8037a1a80972d1332acecb9ff1013f431 (diff)
improve fpic for gcc
Diffstat (limited to 'xmake/modules/core/tools/gcc.lua')
-rw-r--r--xmake/modules/core/tools/gcc.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 224dc6c2d..240ec2855 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -42,7 +42,11 @@ function init(self)
self:set("shflags", "-shared")
-- add -fPIC for shared
- if not is_plat("windows", "mingw") then
+ --
+ -- we need check it for clang/gcc with window target
+ -- @see https://github.com/xmake-io/xmake/issues/1392
+ --
+ if not is_plat("windows", "mingw") and self:has_flags("-fPIC", "cxflags") then
self:add("shflags", "-fPIC")
self:add("shared.cxflags", "-fPIC")
end