diff options
| author | ruki <[email protected]> | 2015-06-04 15:46:43 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-06-04 15:46:43 +0800 |
| commit | 6c5fbedfe26db54b0bbb95fa9154ed759c7ad98f (patch) | |
| tree | c7a1d2ba8ee4076e7576df79a53c1dfaadf7f14b /xmake/scripts/platform/iphoneos | |
| parent | 83295bd3a1b27f844759aeadbbdc23f51e2f2d89 (diff) | |
rebuild compiler and linker
Diffstat (limited to 'xmake/scripts/platform/iphoneos')
| -rw-r--r-- | xmake/scripts/platform/iphoneos/iphoneos.lua | 58 | ||||
| -rw-r--r-- | xmake/scripts/platform/iphoneos/prober.lua | 24 |
2 files changed, 40 insertions, 42 deletions
diff --git a/xmake/scripts/platform/iphoneos/iphoneos.lua b/xmake/scripts/platform/iphoneos/iphoneos.lua index 872f7c2e1..7c6567416 100644 --- a/xmake/scripts/platform/iphoneos/iphoneos.lua +++ b/xmake/scripts/platform/iphoneos/iphoneos.lua @@ -17,42 +17,40 @@ -- Copyright (C) 2009 - 2015, ruki All rights reserved. -- -- @author ruki --- @file _iphoneos.lua +-- @file iphoneos.lua -- --- define module: _iphoneos -local _iphoneos = _iphoneos or {} +-- define module: iphoneos +local iphoneos = iphoneos or {} -- load modules local config = require("base/config") -- init host -_iphoneos._HOST = "macosx" +iphoneos._HOST = "macosx" -- init architectures -_iphoneos._ARCHS = {"armv7", "armv7s", "arm64"} +iphoneos._ARCHS = {"armv7", "armv7s", "arm64"} -- make configure -function _iphoneos.make(configs) +function iphoneos.make(configs) - -- init the file name format - configs.format = {} - configs.format.static = {"lib", ".a"} - configs.format.object = {"", ".o"} - configs.format.shared = {"lib", ".dylib"} - - -- init the compiler - configs.compiler = {} - configs.compiler.cc = config.get("cc") or "xcrun -sdk iphoneos clang" - configs.compiler.cxx = config.get("cxx") or "xcrun -sdk iphoneos clang++" - configs.compiler.mm = config.get("mm") or configs.compiler.cc - configs.compiler.mxx = config.get("mxx") or configs.compiler.cxx + -- init the file formats + configs.formats = {} + configs.formats.static = {"lib", ".a"} + configs.formats.object = {"", ".o"} + configs.formats.shared = {"lib", ".dylib"} - -- init the linker - configs.linker = {} - configs.linker.binary = config.get("ld") or "xcrun -sdk iphoneos clang++" - configs.linker.static = config.get("ar") or "xcrun -sdk iphoneos ar" - configs.linker.shared = config.get("sh") or "xcrun -sdk iphoneos clang++" + -- init the toolchains + configs.tools = {} + configs.tools.make = "make" + configs.tools.cc = config.get("cc") or "xcrun -sdk iphoneos clang" + configs.tools.cxx = config.get("cxx") or "xcrun -sdk iphoneos clang++" + 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 "xcrun -sdk iphoneos clang++" + configs.tools.ar = config.get("ar") or "xcrun -sdk iphoneos ar" + configs.tools.sh = config.get("sh") or "xcrun -sdk iphoneos clang++" -- init xcode sdk directory configs.xcode_sdkdir = config.get("xcode_dir") .. "/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS" .. config.get("xcode_sdkver") .. ".sdk" @@ -60,10 +58,10 @@ function _iphoneos.make(configs) end -- get the option menu for action: xmake config or global -function _iphoneos.menu(action) +function iphoneos.menu(action) -- init config option menu - _iphoneos._MENU_CONFIG = _iphoneos._MENU_CONFIG or + iphoneos._MENU_CONFIG = iphoneos._MENU_CONFIG or { {} , {nil, "mm", "kv", nil, "The Objc Compiler" } , {nil, "mxx", "kv", nil, "The Objc++ Compiler" } @@ -80,7 +78,7 @@ function _iphoneos.menu(action) , } -- init global option menu - _iphoneos._MENU_GLOBAL = _iphoneos._MENU_GLOBAL or + iphoneos._MENU_GLOBAL = iphoneos._MENU_GLOBAL or { {} , {nil, "xcode_dir", "kv", "auto", "The Xcode Application Directory" } , {} @@ -91,12 +89,12 @@ function _iphoneos.menu(action) -- get the option menu if action == "config" then - return _iphoneos._MENU_CONFIG + return iphoneos._MENU_CONFIG elseif action == "global" then - return _iphoneos._MENU_GLOBAL + return iphoneos._MENU_GLOBAL end end --- return module: _iphoneos -return _iphoneos +-- return module: iphoneos +return iphoneos diff --git a/xmake/scripts/platform/iphoneos/prober.lua b/xmake/scripts/platform/iphoneos/prober.lua index f28d0a672..d8a1c5330 100644 --- a/xmake/scripts/platform/iphoneos/prober.lua +++ b/xmake/scripts/platform/iphoneos/prober.lua @@ -17,7 +17,7 @@ -- Copyright (C) 2009 - 2015, ruki All rights reserved. -- -- @author ruki --- @file _prober.lua +-- @file prober.lua -- -- load modules @@ -26,11 +26,11 @@ local path = require("base/path") local utils = require("base/utils") local string = require("base/string") --- define module: _prober -local _prober = _prober or {} +-- define module: prober +local prober = prober or {} -- probe the architecture -function _prober._probe_arch(configs) +function prober._probe_arch(configs) -- get the architecture local arch = configs.arch @@ -46,7 +46,7 @@ function _prober._probe_arch(configs) end -- probe the xcode application directory -function _prober._probe_xcode(configs) +function prober._probe_xcode(configs) -- get the xcode directory local xcode_dir = configs.xcode_dir @@ -88,7 +88,7 @@ function _prober._probe_xcode(configs) end -- probe the xcode sdk version -function _prober._probe_xcode_sdkver(configs) +function prober._probe_xcode_sdkver(configs) -- get the xcode sdk version local xcode_sdkver = configs.xcode_sdkver @@ -126,18 +126,18 @@ function _prober._probe_xcode_sdkver(configs) end -- probe the configure -function _prober.done(configs, is_global) +function prober.done(configs, is_global) -- probe the architecture - if not _prober._probe_arch(configs) then return end + if not prober._probe_arch(configs) then return end -- probe the xcode application directory - if not _prober._probe_xcode(configs) then return end + if not prober._probe_xcode(configs) then return end -- probe the xcode sdk version - if not is_global and not _prober._probe_xcode_sdkver(configs) then return end + if not is_global and not prober._probe_xcode_sdkver(configs) then return end end --- return module: _prober -return _prober +-- return module: prober +return prober |
