-
-
Notifications
You must be signed in to change notification settings - Fork 620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't treat "dependson" libraries as "links" libraries in Xcode #644
Conversation
c7e03ff
to
f5b94fb
Compare
Any thoughts? I'm trying to port the BZFlag build system to premake5, but it will be easier for me to sell our other developers on it if our premake scripts don't require workarounds, such as for this bug. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This solution is expensive for large workspaces with many projects that depend on each other but don't link.
Consider making the internals of the loop a function instead with a simple build
/link
parameter.
Furthermore, instead of using nobuild
to flag whether or not something should build, instead consider using build
/link
and checking if node.build != false
. This will assume true
and be much easier to read than "not no build".
I can rework it to get rid of the double negative wording.
Can you explain more what you mean by this? I'm new to lua, but from what I've read the only way to test whether a value is in a table is by iterating through it. So, as long as we depend on the existing I could, however, probably move my call to |
Basically, something like this: function xcode.addDependency(tr, dep, build)
-- create a child node for the dependency's xcodeproj
local xcpath = xcode.getxcodeprojname(dep)
local xcnode = tree.insert(tr.projects, tree.new(path.getname(xcpath)))
xcnode.path = xcpath
xcnode.project = dep
xcnode.productgroupid = xcode.newid(xcnode.name, "prodgrp")
xcnode.productproxyid = xcode.newid(xcnode.name, "prodprox")
xcnode.targetproxyid = xcode.newid(xcnode.name, "targprox")
xcnode.targetdependid = xcode.newid(xcnode.name, "targdep")
-- create a grandchild node for the dependency's link target
local lprj = premake.workspace.findproject(prj.workspace, dep.name)
local cfg = project.findClosestMatch(lprj, prj.configurations[1])
node = tree.insert(xcnode, tree.new(cfg.linktarget.name))
node.path = cfg.linktarget.fullpath
node.cfg = cfg
if build == false then
node.nobuild = true
end
end
-- Back inside xcode.buildprjtree
for _, dep in ipairs(project.getdependencies(prj, "linkOnly")) do
addDependency(tr, dep, true)
end
for _, dep in ipairs(project.getdependencies(prj, "dependOnly")) do
addDependency(tr, dep, false)
end |
…ed into the executable in Xcode.
f5b94fb
to
c5b9948
Compare
I fixed the inefficiency per your suggestion. I looked at alternatives for the |
c5b9948
to
47e3bd4
Compare
Maybe renaming |
Changed |
This patch corrects an issue with the xcode module where if you list a library you're building under "dependson," Xcode would add it to the target dependencies but also to the link dependencies, which is undesired. With this fix, you can now use "links" and "dependson" as desired and they both work as intended.
Fixes #631.