From a9da9dee9f83abfe04ffbbd865156494c135161e Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 30 Jun 2015 10:45:41 +0800 Subject: make universal target for iphoneos --- xmake/scripts/action/_package.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'xmake/scripts/action/_package.lua') diff --git a/xmake/scripts/action/_package.lua b/xmake/scripts/action/_package.lua index 6743a140d..3fc9f6e4b 100644 --- a/xmake/scripts/action/_package.lua +++ b/xmake/scripts/action/_package.lua @@ -150,20 +150,24 @@ function _package._makeconf(target_name, target) configs_arch.targetfile = _package._backup(configs_arch.targetdir, rule.targetfile(target_name, target)) -- save the package script - configs_target.pkgscript = target.pkgscript - if type(configs_target.pkgscript) == "string" and os.isfile(configs_target.pkgscript) then - local script, errors = loadfile(configs_target.pkgscript) + local pkgscript = target.pkgscript + if type(pkgscript) == "string" and os.isfile(pkgscript) then + local script, errors = loadfile(pkgscript) if script then - configs_target.pkgscript = script() + pkgscript = script() + if type(pkgscript) == "table" and pkgscript.main then + pkgscript = pkgscript.main + end else utils.error(errors) return false end end - if target.pkgscript and type(configs_target.pkgscript) ~= "function" then + if target.pkgscript and type(pkgscript) ~= "function" then utils.error("invalid package script!") return false end + configs_target.pkgscript = pkgscript -- ok return true -- cgit v1.3.1