summaryrefslogtreecommitdiff
path: root/xmake/modules/core
diff options
context:
space:
mode:
authorruki <[email protected]>2019-04-03 00:48:49 +0800
committerruki <[email protected]>2019-04-02 22:52:56 +0800
commit09a1f710f009c7b90deea8a0e2c788551c03e66c (patch)
tree352fefed6af060924cc665b4aa59f92b2f43b1bd /xmake/modules/core
parent7175aa15a46eb6c6c8b87755719d39fbd904d983 (diff)
fix -fPIC for nvcc
Diffstat (limited to 'xmake/modules/core')
-rw-r--r--xmake/modules/core/tools/clang.lua5
-rw-r--r--xmake/modules/core/tools/gcc.lua2
2 files changed, 6 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/clang.lua b/xmake/modules/core/tools/clang.lua
index a54297a4d..7dcc02b5c 100644
--- a/xmake/modules/core/tools/clang.lua
+++ b/xmake/modules/core/tools/clang.lua
@@ -31,6 +31,11 @@ function init(self)
-- init super
_super.init(self)
+ -- add -fPIC for shared
+ if not is_plat("windows", "mingw") then
+ self:add("clang.shflags", "-fPIC") -- only for clang
+ end
+
-- suppress warning
self:add("cxflags", "-Qunused-arguments")
self:add("mxflags", "-Qunused-arguments")
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index c9dd32508..d21cbe99f 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -45,7 +45,7 @@ function init(self)
-- add -fPIC for shared
if not is_plat("windows", "mingw") then
- self:add("shflags", "-fPIC")
+ self:add("gcc.shflags", "-fPIC") -- only for gcc
self:add("shared.cxflags", "-fPIC")
end