diff options
| author | ruki <[email protected]> | 2019-04-03 22:18:36 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-04-03 07:51:38 +0800 |
| commit | adbcc87f0699702c32fa8dc63aa8aafaa1deca9d (patch) | |
| tree | e0bc6b981218c77081878e2ec1ff0d14296c3c01 /xmake/modules | |
| parent | 09a1f710f009c7b90deea8a0e2c788551c03e66c (diff) | |
improve linker
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/core/tools/clang.lua | 5 | ||||
| -rw-r--r-- | xmake/modules/core/tools/dmd.lua | 4 | ||||
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/core/tools/go.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/core/tools/ldc2.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/core/tools/nvcc.lua | 3 | ||||
| -rw-r--r-- | xmake/modules/core/tools/rustc.lua | 6 |
7 files changed, 11 insertions, 13 deletions
diff --git a/xmake/modules/core/tools/clang.lua b/xmake/modules/core/tools/clang.lua index 7dcc02b5c..a54297a4d 100644 --- a/xmake/modules/core/tools/clang.lua +++ b/xmake/modules/core/tools/clang.lua @@ -31,11 +31,6 @@ 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/dmd.lua b/xmake/modules/core/tools/dmd.lua index c11fea5fc..63e9a8313 100644 --- a/xmake/modules/core/tools/dmd.lua +++ b/xmake/modules/core/tools/dmd.lua @@ -31,10 +31,10 @@ import("core.project.project") function init(self) -- init arflags - self:set("arflags", "-lib") + self:set("dc-arflags", "-lib") -- init shflags - self:set("shflags", "-shared", "-fPIC") + self:set("dc-shflags", "-shared", "-fPIC") -- init dcflags for the kind: shared self:set("shared.dcflags", "-fPIC") diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index d21cbe99f..c9dd32508 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("gcc.shflags", "-fPIC") -- only for gcc + self:add("shflags", "-fPIC") self:add("shared.cxflags", "-fPIC") end diff --git a/xmake/modules/core/tools/go.lua b/xmake/modules/core/tools/go.lua index 5bda5022b..d23bbd0a2 100644 --- a/xmake/modules/core/tools/go.lua +++ b/xmake/modules/core/tools/go.lua @@ -31,7 +31,7 @@ import("core.project.project") function init(self) -- init arflags - self:set("arflags", "grc") + self:set("gc-arflags", "grc") -- init the file formats self:set("formats", { static = "$(name).a" }) diff --git a/xmake/modules/core/tools/ldc2.lua b/xmake/modules/core/tools/ldc2.lua index c21f90a8f..a9b95af5e 100644 --- a/xmake/modules/core/tools/ldc2.lua +++ b/xmake/modules/core/tools/ldc2.lua @@ -32,7 +32,7 @@ function init(self) _super.init(self) -- init shflags - self:set("shflags", "-shared") + self:set("dc-shflags", "-shared") -- init cxflags for the kind: shared self:set("shared.dcflags", "") diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua index 1e8186401..64bb24bad 100644 --- a/xmake/modules/core/tools/nvcc.lua +++ b/xmake/modules/core/tools/nvcc.lua @@ -32,6 +32,9 @@ import("detect.tools.find_ccache") -- init it function init(self) + -- init shflags + self:set("cu-shflags", "-shared") + -- init flags if not is_plat("windows") then self:set("shared.cuflags", "-Xcompiler -fPIC") diff --git a/xmake/modules/core/tools/rustc.lua b/xmake/modules/core/tools/rustc.lua index d98d96e5a..0fa38598a 100644 --- a/xmake/modules/core/tools/rustc.lua +++ b/xmake/modules/core/tools/rustc.lua @@ -31,13 +31,13 @@ import("core.project.project") function init(self) -- init arflags - self:set("arflags", "--crate-type=lib") + self:set("rc-arflags", "--crate-type=lib") -- init shflags - self:set("shflags", "--crate-type=dylib") + self:set("rc-shflags", "--crate-type=dylib") -- init ldflags - self:set("ldflags", "--crate-type=bin") + self:set("rc-ldflags", "--crate-type=bin") -- init the file formats self:set("formats", { static = "lib$(name).rlib" }) |
