-
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
Added "native" kwarg to add_XXX_args. Closes #3669. #3921
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
## Projects args can be set separately for cross and native builds (potentially breaking change) | ||
|
||
It has been a longstanding bug (or let's call it a "delayed bug fix") | ||
that if yodo this: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpick: Typo |
||
|
||
```meson | ||
add_project_arguments('-DFOO', language : 'c') | ||
``` | ||
|
||
Then the flag is used both in native and cross compilations. This is | ||
very confusing and almost never what you want. To fix this a new | ||
keyword `native` has been added to all functions that add arguments, | ||
namely `add_global_arguments`, `add_global_link_arguments`, | ||
`add_project_arguments` and `add_project_link_arguments` that behaves | ||
like the following: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This paragraph does not mention that from now on the flag will only be used when the cross compiler is invoked. |
||
|
||
``` | ||
## Added to native builds when compiling natively and to cross | ||
## compilations when doing cross compiles. | ||
add_project_arguments(...) | ||
|
||
## Added only to native compilations, not used in cross compilations. | ||
add_project_arguments(..., native : true) | ||
|
||
## Added only to corss compilations, not used in native compilations. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo |
||
add_project_arguments(..., native : false) | ||
``` | ||
|
||
Also remember that cross compilation is a property of each | ||
target. There can be target that are compiled with the native compiler | ||
and some which are compiled with the cross compiler. | ||
|
||
Unfortunately this change is backwards incompatible and may cause some | ||
projects to fail building. However this should be very rare in practice. |
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 para is a bit confusing. I would reword it as:
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.
That's not the same wording. If set to
false
then they won't be added to native targets ever. The table goes (or should go at least) like this: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.
Perhaps it's better to put it in a table form? Should be easier to parse than a paragraph.