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

Allow for cmake w-flags addition #14102

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

Conversation

ligazetom
Copy link

Take this as a rough proposal - I've read the docs so I know there are more requirements, but I don't feel like spending that much time on something that is maybe not considered for a reason. I have no issues with adding all that is required afterwards.

During configuration of many 3rd party projects I'm getting a lot of messages meant for developers of those libraries which can be silenced using -Wno-dev flag passed to cmake. It cluttered the output so much I've started looking into it and spending better half a day on the issue I haven't found a way how to do it 'the right way'.

There are cmake_options that can be passed to cmake.subproject which I ended up with, but deprecated feature warning comes with it - still it's easier on the eyes than all the other unwanted output.

I've look around the documentation, many issues, conversations and finally source code and I haven't been able to find such option. I've tried even to 'hack' add_cmake_defines with something like 'DUMMYSTART=False -Wno-dev -DDUMMYEND' : false but to no one's surprise, arguments are being passed properly 😄

After all this I've come up with one solution myself and although it works, it is just that. Working proposal.

I don't know why it's not yet exposed, if there are some reasons to keep end user safe whatever just let me know. If it's something that could be implemented I'd gladly finish it, but I've come across the whole environment variables topic (python script to generate meson.options with resolved variables is working just great btw. but still), so I'm familiar with some forced limitations already. If this is one of those, feel free to close this PR.

@ligazetom ligazetom requested a review from mensinda as a code owner January 9, 2025 16:20
@dcbaker
Copy link
Member

dcbaker commented Jan 9, 2025

Honestly... I'm not sure why we don't just pass -Wno-dev by default to CMake invocations. 99% of the time the project is being consumed by someone who isn't in a position to fix it. Or at least have a meson builtin option like -Dcmake_warnings=<bool>

@eli-schwartz
Copy link
Member

Honestly... I'm not sure why we don't just pass -Wno-dev by default to CMake invocations. 99% of the time the project is being consumed by someone who isn't in a position to fix it.

This is my initial gut feeling as well.

@ligazetom
Copy link
Author

I had that as well on this line, but then I thought "What if I have older cmake project" or something like that, so I decided not to go that way, but idk. I'm all about default options, but only with a way to opt-out provided.

I'm sure I'm still not caught up to meson mantra of limits and internal workings to even consider removal of general way of providing options to cmake at all so it's also wierd for me to provide my proposed method to do this in a first place, but the no-dev is only one of many flags right, so if there are already people looking into this, why not make it a bit more useful.

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.

3 participants