-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 new add_project_[link]_args functions #1030
Conversation
605ca1d
to
b05b83a
Compare
if cc.get_id() == 'msvc' | ||
add_global_arguments('/DGLOBAL_ARGUMENT', language: 'c') | ||
add_project_arguments('/DPROJECT_OPTION', language: 'c') | ||
add_project_arguments('/DPROJECT_OPTION_1', language: 'c') |
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 is not required. Just use -DGLOBAL_ARGUMENT
etc. MSVC understands that.
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.
Well it was failling with MSVC and suspected this was the reason.
|
||
cc = meson.get_compiler('c') | ||
if cc.get_id() == 'msvc' | ||
add_project_arguments('/DSUBPROJECT_OPTION', language: 'c') |
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.
Same.
f7f4460
to
7aa3ef5
Compare
Travis build failed because Appveyor build is stuck, and the Internet tells me that when this happens you're supposed to cancel the stuck build and kick off a new one. @jpakkane needs to do that. |
Please re-push to trigger a rebuild :) |
7aa3ef5
to
8ef7cf0
Compare
Done.. let's see how it goes :) |
7242baa
to
99e77c8
Compare
There should be a test that uses C++ and which checks that the project options set for C have not leaked into other languages. |
It would also be nice to test that target-specific c/cpp arguments override project arguments. |
@@ -1944,6 +1945,7 @@ def generate_link(self, target, outfile, outname, obj_list, linker, extra_args=[ | |||
commands = [] | |||
if not isinstance(target, build.StaticLibrary): | |||
commands += self.build.get_global_link_args(linker) | |||
commands += self.build.get_project_link_args(linker, target.subproject) |
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.
At least -L
arguments should be the other way around. The first one is used so for those project link args should be before global ones. But what about other linker arguments? I think that for other ones the last one is the deciding one. Maybe we should just stick to this order and fix things if they actually break in the wild?
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 we should be doing is gathering all the -L
arguments from all sources into one OrderedDict
and then generating the command from that. What you're pointing out is already a problem with our linker argument list since global link -L
arguments override target-specific ones.
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.
Done
Args froze is not tested at all (I thought I had written a test for that but grepping says no). This needs a failing test that rougly does the following:
Apart from these two fixes this looks good. |
Done
Done |
99e77c8
to
ac0fca0
Compare
ac0fca0
to
af28abd
Compare
Fixes 979