Skip to content
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

BuildTarget: Add ignore_project_(link_)args() kwarg #3520

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xclaesse
Copy link
Member

@xclaesse xclaesse commented May 3, 2018

When all targets must use some args in a project with the exception of a
few, it's easier to use add_project_(link_)args() and flag only the few
exceptions instead of having to set link_args/c_args on all targets.

When all targets must use some args in a project with the exception of a
few, it's easier to use add_project_(link_)args() and flag only the few
exceptions instead of having to set link_args/c_args on all targets.
@@ -72,6 +72,9 @@ This function behaves in the same way as `add_global_arguments` except
that the arguments are only used for the current project, they won't
be used in any other subproject.

Since 0.47.0 those flags can be ignored by by some targets by setting their
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*these, same below

@@ -474,6 +480,10 @@ be passed to [shared and static libraries](#library).
in the D programming language
- `d_unittest`, when set to true, the D modules are compiled in debug mode
- `d_module_versions` list of module versions set when compiling D sources
- `ignore_project_args` Ignore arguments added via
[`add_project_arguments()`](#add_project_arguments)? Since 0.47.0.
- `ignore_project_link_args` Ignore arguments added via
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be phrased as "when set to true, ignore arguments [...]` otherwise people may not realize what values should be passed to these.

@@ -0,0 +1,6 @@
## ignore project arguments in some targets
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*Ignore

app = executable('testapp', 'main.c',
ignore_project_args : true,
ignore_project_link_args : true,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't this be included in the 123 subproject project arguments test? I mention this because adding new tests has more test time overhead than adding a few lines to an existint test.

@pwithnall
Copy link
Contributor

pwithnall commented May 9, 2018

I wonder if it would be better to have an override_link_args argument to executable(), which overrides the whole set of linker arguments for that target (including project-wide arguments). Then you could set it to (in pseudocode) override_link_args : filter(project_args, '-Wl,-z,nodelete') or whatever. Then the calculation for the linker arguments for that target is all in one place, rather than spread across the project linker args and the ignore list.

@tristan957
Copy link
Contributor

tristan957 commented May 23, 2023

Do people still see value in this? Not sure that I do. Any real-world use-cases people want this for? This just seems like people being too liberal with add_project_arguments()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants