diff options
author | Jason Perkins <starkos@industriousone.com> | 2013-08-15 22:14:53 +0400 |
---|---|---|
committer | Jason Perkins <starkos@industriousone.com> | 2013-08-15 22:14:53 +0400 |
commit | 29945bd494b831398d569143fb082bd9c651b541 (patch) | |
tree | 8b579d6c832cbd03e646356078a421b92d57bead | |
parent | c964fef63467b5b85b5ff59898f50f436e6290b2 (diff) |
Bug #280: Problem with prebuild, prelink, and postbuild commands in Xcode (Ben Henning)
-rw-r--r-- | src/actions/xcode/xcode_common.lua | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/actions/xcode/xcode_common.lua b/src/actions/xcode/xcode_common.lua index 173d0c4..e18feed 100644 --- a/src/actions/xcode/xcode_common.lua +++ b/src/actions/xcode/xcode_common.lua @@ -432,20 +432,37 @@ for _, node in ipairs(tr.products.children) do local name = tr.project.name + -- This function checks whether there are build commands of a specific + -- type to be executed; they will be generated correctly, but the project + -- commands will not contain any per-configuration commands, so the logic + -- has to be extended a bit to account for that. + local function hasBuildCommands(which) + -- standard check...this is what existed before + if #tr.project[which] > 0 then + return true + end + -- what if there are no project-level commands? check configs... + for _, cfg in ipairs(tr.configs) do + if #cfg[which] > 0 then + return true + end + end + end + _p(2,'%s /* %s */ = {', node.targetid, name) _p(3,'isa = PBXNativeTarget;') _p(3,'buildConfigurationList = %s /* Build configuration list for PBXNativeTarget "%s" */;', node.cfgsection, name) _p(3,'buildPhases = (') - if #tr.project.prebuildcommands > 0 then + if hasBuildCommands('prebuildcommands') then _p(4,'9607AE1010C857E500CD1376 /* Prebuild */,') end _p(4,'%s /* Resources */,', node.resstageid) _p(4,'%s /* Sources */,', node.sourcesid) - if #tr.project.prelinkcommands > 0 then + if hasBuildCommands('prelinkcommands') then _p(4,'9607AE3510C85E7E00CD1376 /* Prelink */,') end _p(4,'%s /* Frameworks */,', node.fxstageid) - if #tr.project.postbuildcommands > 0 then + if hasBuildCommands('postbuildcommands') then _p(4,'9607AE3710C85E8F00CD1376 /* Postbuild */,') end _p(3,');') |