-
-
Notifications
You must be signed in to change notification settings - Fork 617
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
Add frameworkdirs support to gmake and gmake2 with gcc/clang toolsets… #1661
Conversation
src/tools/gcc.lua
Outdated
dir = project.getrelative(cfg.project, dir) | ||
table.insert(result, '-I' .. p.quoted(dir)) | ||
end | ||
|
||
if (table.contains(os.getSystemTags(cfg.system), "darwin") | ||
and cfg.frameworkdirs ~= nil and #cfg.frameworkdirs) then |
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 should be on one line. This isn't using the right variable, shouldn't be using cfg.
for frameworkdirs
. Also, this is not consistent with the other dirs
blocks by checking the value of cfg.frameworkdirs
/frameworkdirs
.
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.
Ok for the "one-line".
The use of cfg. is a copy-paste-is-evil mistake (from gcc.getLibraryDirectories(cfg)
), that I previously fixed and re-introduced while rebasing for this PR...
The test on frameworkdirs value is made to minimize changes in code. Otherwise it will
require to add , {}
on all toolset.getincludedirs()
calls. I suggest to keep it for now.
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.
The test on frameworkdirs value is made to minimize changes in code. Otherwise it will
require to add, {}
on alltoolset.getincludedirs()
calls. I suggest to keep it for now.
Sorry to be pedantic, but isn't that why you have the or {}
inside? Which is how the sysdirs
loop works too. Checking if frameworkdirs
is not nil
isn't necessary because you're already doing ipairs(frameworkdirs or {})
?
16698cd
to
53e3930
Compare
@@ -521,7 +521,7 @@ end | |||
|
|||
|
|||
function make.includes(cfg, toolset) | |||
local includes = toolset.getincludedirs(cfg, cfg.includedirs, cfg.sysincludedirs) | |||
local includes = toolset.getincludedirs(cfg, cfg.includedirs, cfg.sysincludedirs, cfg.frameworkdirs) |
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.
Should probably be done for all exporters.
Seems you miss several getincludedirs
in project (even if I'm not sure if resource need it).
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 "miss" was intentional. I don't think resflags needs framework dirs.
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.
For resources, it might be OK, but I would pass nil
explicitly.
For gmake2, only for "per-file" configuration has been done.
Missing for Codelite generator...
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.
I am not against an explicit nil, however there is currently no toolset.getincludedirs(cfg, inc, nil)
when sysdir is not mandatory.
About gmake2, Ok, I didn't understand your first message quite well. This will be fixed.
About CodeLite, I said in the PR message I am not using CodeLite, have no knowledge about it and I can't test it.
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.
sysdir
is missing only for resources flags (I wonder it is not a bug BTW).
You should add frameworkdirs
for all non-resources flags call (for all generators).
It is the toolset which "manages" it. (as msvc which does nothing).
if generator doesn't use directly compiler flags, it iterates directly on cfg.includedirs
or similar, and then indeed, it would require knowledge of the generator.
For test, I started https://github.com/Jarod42/premake-sample-projects to test with projects with multiple generators.
Nothing platform specific yet, as frameworks
If you can provide sample test project (usable in github action) (a variant of project-01 which test includedirs), I can add it.
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.
@Jarod42 It is okay if contributors only want to target a single toolset. Not everyone has access to every toolset; allowing people to contribute where they can is more important. And please do not confuse things by asking people to provide you with tests for a separate repository; unit tests are all that we require at this time. Thanks!
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.
@starkos: What bothers me is that, then projects are generator-specific without any errors/warnings for users when used with incompatible generators.
Sorry, I didn't want to confuse people with extra tests in another repository.
Notice that you have tests just for gcc, but not for gmake/gmake2.
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.
What bothers me is that, then projects are generator-specific without any errors/warnings for users when used with incompatible generators.
The alternative is that people don't contribute. We've been down that path before. I do agree that we need to do a better job of surfacing compatibility information, and the documentation seems an appropriate place to do that.
@Jarod42 If you have general comments on broad topics ("features should be implemented for all generators") please use the provided Discussions rather than cluttering up the PR review notes. I have no longer have any idea what change was requested by this thread, and if it has been done or not.
local result = {} | ||
for _, dir in ipairs(dirs) do | ||
dir = project.getrelative(cfg.project, dir) | ||
table.insert(result, '-I' .. p.quoted(dir)) | ||
end | ||
|
||
if (table.contains(os.getSystemTags(cfg.system), "darwin") and frameworkdirs ~= nil) then | ||
for _, dir in ipairs(frameworkdirs or {}) do |
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.
Below doesn't have or {}
.
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.
and frameworkdirs ~= nil
is probably the one to remove here
cfcb119
to
1fdd175
Compare
… on macOS systems * Add new optional parameter to toolset.getincludedirs(dirs, sysdirs, frameworkdirs) * Translate frameworkdirs to -F<path> build & linker flags * Add tests Co-authored-by: Joris Dauphin <Jarod42@users.noreply.github.com> Co-authored-by: Samuel Surtees <samsinsane@users.noreply.github.com>
1fdd175
to
f78741f
Compare
Hello, |
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.
Approving, but will let @samsinsane make the call on the merge since they've been more involved in the review.
Oh shoot, I see @samsinsane already approved…merging… |
… on macOS systems
Anything else we should know?
It should be easy to update CodeLite too but I can't really test it.
Did you check all the boxes?
closes #XXXX
in comment to auto-close issue when PR is merged)