diff options
| author | ruki <[email protected]> | 2021-11-02 00:39:57 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-11-02 00:39:57 +0800 |
| commit | 1c667ecedce4a2f90f32787f7f667f967421ec1f (patch) | |
| tree | 38951721fdcd227a14be05d936663300731dc62a /xmake/modules/core/tools/gcc.lua | |
| parent | bef276b8037a1a80972d1332acecb9ff1013f431 (diff) | |
improve fpic for gcc
Diffstat (limited to 'xmake/modules/core/tools/gcc.lua')
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 6 |
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 |
