diff options
Diffstat (limited to 'xmake/scripts/platform/linux/linux.lua')
| -rw-r--r-- | xmake/scripts/platform/linux/linux.lua | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/xmake/scripts/platform/linux/linux.lua b/xmake/scripts/platform/linux/linux.lua index 6c68a6f1b..40f9b5999 100644 --- a/xmake/scripts/platform/linux/linux.lua +++ b/xmake/scripts/platform/linux/linux.lua @@ -43,15 +43,30 @@ function linux.make(configs) -- init the toolchains configs.tools = {} - configs.tools.make = "make" + configs.tools.make = config.get("make") configs.tools.ccache = config.get("__ccache") - configs.tools.cc = config.get("cc") or "gcc" - configs.tools.cxx = config.get("cxx") or "g++" - configs.tools.mm = config.get("mm") or configs.tools.cc - configs.tools.mxx = config.get("mxx") or configs.tools.cxx - configs.tools.ld = config.get("ld") or "g++" - configs.tools.ar = config.get("ar") or "ar" - configs.tools.sh = config.get("sh") or "g++" + configs.tools.cc = config.get("cc") + configs.tools.cxx = config.get("cxx") + configs.tools.mm = config.get("mm") + configs.tools.mxx = config.get("mxx") + configs.tools.ld = config.get("ld") + configs.tools.ar = config.get("ar") + configs.tools.sh = config.get("sh") + + -- init flags for architecture + local archflags = nil + local arch = config.get("arch") + if arch then + if arch == "x64" then archflags = "-m64" + elseif arch == "x86" then archflags = "-m32" + else archflags = "-arch " .. arch + end + end + configs.cxflags = { archflags } + configs.mxflags = { archflags } + configs.asflags = { archflags } + configs.ldflags = { archflags } + configs.shflags = { archflags } end |
