Meson werror option



Hi All Testers!

Balsa has always been configured so that if it is built from a development source tree, currently a git tree from 
GitLab, the "-Werror" flag is passed to the compiler. That means that compiler warnings are escalated to 
errors and the build fails, which is a great incentive for fixing warnings ;-)

That's currently set up for both the autotools build and for Meson. But Meson has a "--werror" option which has the same effect; "-Werror" is passed 
to the compiler, at least if it's gcc or similar; options like that are preferred over explicit compiler flags (for portability, I guess). But there doesn't seem to be 
any way to set them conditionally, like we always have with "-Werror". So we could drop the explicit "-Werror" flag and just pass 
"--werror" to Meson, for instance as "meson configure --werror" in the build directory. But that puts the onus on the tester to ensure that the flag 
gets set.

For myself, I keep a file meson-config with all the options that I use, and make a build directory using

meson `cat path/to/meson-config` path/to/build-dir

so, to test dropping the explicit "-Werror" flag, I just had to add "--werror" to meson-config and it all 
works. But we all have different work-flows, and dropping it might be more of a problem for some.

Comments?

Peter

Attachment: pgpjU85k5zaSn.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]