diff options
| author | ruki <[email protected]> | 2015-06-05 16:06:45 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-06-05 16:06:45 +0800 |
| commit | 411e3138ec53ab99c73f0124ef93ac98d746cdc9 (patch) | |
| tree | d7e719ea57e12402f630deb1ed998a00304510ff /xmake/scripts/tools | |
| parent | fe68854c321f2e586cab55dce6856b89241b4c20 (diff) | |
join flags for compiler and linker
Diffstat (limited to 'xmake/scripts/tools')
| -rw-r--r-- | xmake/scripts/tools/ar.lua | 2 | ||||
| -rw-r--r-- | xmake/scripts/tools/clang.lua | 24 |
2 files changed, 15 insertions, 11 deletions
diff --git a/xmake/scripts/tools/ar.lua b/xmake/scripts/tools/ar.lua index e39967117..008aba7b6 100644 --- a/xmake/scripts/tools/ar.lua +++ b/xmake/scripts/tools/ar.lua @@ -35,7 +35,7 @@ function ar.init(name) ar.name = name or "ar" -- init arflags - ar.arflags = "-crs" + ar.arflags = { "-crs" } end diff --git a/xmake/scripts/tools/clang.lua b/xmake/scripts/tools/clang.lua index 0e2ac3dbd..d8fdbaf4b 100644 --- a/xmake/scripts/tools/clang.lua +++ b/xmake/scripts/tools/clang.lua @@ -22,6 +22,7 @@ -- load modules local utils = require("base/utils") +local table = require("base/table") local string = require("base/string") local config = require("base/config") @@ -46,28 +47,31 @@ function clang.init(name) end -- init cxflags - clang.cxflags = flags_arch + clang.cxflags = { flags_arch } -- init mxflags - clang.mxflags = flags_arch .. " -fmessage-length=0 -pipe -fpascal-strings" - .. " \"-DIBOutlet=__attribute__((iboutlet))\"" - .. " \"-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))\"" - .. " \"-DIBAction=void)__attribute__((ibaction)\"" + clang.mxflags = { flags_arch + , "-fmessage-length=0" + , "-pipe" + , "-fpascal-strings" + , "\"-DIBOutlet=__attribute__((iboutlet))\"" + , "\"-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))\"" + , "\"-DIBAction=void)__attribute__((ibaction)\""} -- init asflags - clang.asflags = flags_arch + clang.asflags = { flags_arch } -- init ldflags - clang.ldflags = flags_arch + clang.ldflags = { flags_arch } -- init shflags - clang.shflags = flags_arch .. " -dynamiclib" + clang.shflags = { flags_arch, "-dynamiclib" } -- suppress warning for the ccache bug local ccache = config.get("ccache") if ccache and ccache == "y" then - clang.cxflags = clang.cxflags:append("-Qunused-arguments", " ") - clang.mxflags = clang.mxflags:append("-Qunused-arguments", " ") + table.join2(clang.cxflags, "-Qunused-arguments") + table.join2(clang.mxflags, "-Qunused-arguments") end end |
