Added frameworks to PBXBuildFile
This commit is contained in:
parent
5f48d7414e
commit
74a37071f8
@ -22,7 +22,9 @@
|
||||
},
|
||||
|
||||
onsolution = function(sln)
|
||||
premake.generate(sln, "%%.xcodeproj/project.pbxproj", premake.xcode.solution)
|
||||
-- Must ensure a unique name; project may have same name as solution, and they
|
||||
-- share the same file extension. How to handle?
|
||||
-- premake.generate(sln, "%%.xcodeproj/project.pbxproj", premake.xcode.solution)
|
||||
end,
|
||||
|
||||
onproject = function(prj)
|
||||
|
@ -45,6 +45,23 @@
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
-- the special folder "Frameworks" lists all of frameworks linked to project;
|
||||
tr.frameworks = tree.new("Frameworks")
|
||||
for cfg in premake.eachconfig(prj) do
|
||||
for _, link in ipairs(cfg.links) do
|
||||
local name = path.getname(link)
|
||||
if xcode.isframework(name) and not tr.frameworks.children[name] then
|
||||
node = tree.insert(tr.frameworks, tree.new(name))
|
||||
node.path = link
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- only add it to the tree if there are frameworks to link
|
||||
if #tr.frameworks.children > 0 then
|
||||
tree.insert(tr, tr.frameworks)
|
||||
end
|
||||
|
||||
-- Final setup
|
||||
tree.traverse(tr, {
|
||||
|
@ -56,3 +56,15 @@
|
||||
/* End PBXBuildFile section */
|
||||
]]
|
||||
end
|
||||
|
||||
|
||||
function suite.PBXBuildFile_ListsFrameworks()
|
||||
links { "Cocoa.framework" }
|
||||
prepare()
|
||||
xcode.PBXBuildFile(tr)
|
||||
test.capture [[
|
||||
/* Begin PBXBuildFile section */
|
||||
[Cocoa.framework:build] /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = [Cocoa.framework] /* Cocoa.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
]]
|
||||
end
|
||||
|
Reference in New Issue
Block a user