class GnuCPPCompiler(CPPCompiler):
...
old_warn = ['-Wall', '-pedantic', '-Winvalid-pch', '-Wnon-virtual-dtor']
...
Is it possible to disable these defaults? (i.e., start with no flags at all?)
My use case, is that I try to port a legacy project into meson build and this project wiil *not* compile that way.Specifically:1. in gcc-4.4.6 '-pedantic' is not a warning flag but rather an error flag.2. One of the above warning flags actually issues warnings. So now I can't use '-Werror' which the project used to.
Best regards,Noam Meltzer--
You received this message because you are subscribed to the Google Groups "The Meson Build System" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mesonbuild+...@googlegroups.com.
To post to this group, send email to meson...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mesonbuild/0f18e781-a430-47e5-9bad-c272bc03e295%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-Igor Gnatenko
By default meson adds several compiler flags, for example:
class GnuCPPCompiler(CPPCompiler):
...
old_warn = ['-Wall', '-pedantic', '-Winvalid-pch', '-Wnon-virtual-dtor']
Is it possible to disable these defaults? (i.e., start with no flags at all?)
On Tue, Jul 28, 2015 at 2:35 PM, Noam Meltzer <tsn...@gmail.com> wrote:By default meson adds several compiler flags, for example:class GnuCPPCompiler(CPPCompiler):
...
old_warn = ['-Wall', '-pedantic', '-Winvalid-pch', '-Wnon-virtual-dtor']Is it possible to disable these defaults? (i.e., start with no flags at all?)Much like with pkg-config it is highly recommended to use pedantic and fix any issues raised, it is among the easiest ways to improve your code quality. Now obviously there are several cases where you can't do that. In those cases you can do the following.
Built type flags are put at the beginning of the command line. You can override them by adding either per-target flags or global flags. So for example you can do this:add_global_arguments('-Wno-pedantic', language : 'cpp')This will override the build type default flags. If it does not it's a bug and we need to fix it. I'm not sure if gcc 4.6 has -no-pedantic but at least you can disable the individual problematic flags with -Wno-some-test-flags.
You can also use --buildtype=plain as Igor Gnatenko mentioned but note that you also lose debug flags. So you need to do something like this:CPPFLAGS=-g meson src build --buildtype=plain
add_global_arguments('-Wno-pedantic', language : 'cpp')
[1/6] clang++ '-Wno-pedantic' '-Wall' '-Wpedantic' '-Winvalid-pch' '-Wnon-virtual-dtor' '' '-g' '-Imeson-test@exe' '-I..' '-I.' '-I3rdParty/dlib-18.16/.' '-I/home/rhd/src/meson-test-app/3rdParty/dlib-18.16/.' '-MMD' '-MQ' 'meson-test@exe/main.cpp.o' '-MF' 'meson-test@exe/main.cpp.o.d' -o 'meson-test@exe/main.cpp.o' -c ../main.cpp
I tried adding:add_global_arguments('-Wno-pedantic', language : 'cpp')And it doesn't override the pedantic setting, the command line now looks like this:[1/6] clang++ '-Wno-pedantic' '-Wall' '-Wpedantic' '-Winvalid-pch' '-Wnon-virtual-dtor' '' '-g' '-Imeson-test@exe' '-I..' '-I.' '-I3rdParty/dlib-18.16/.' '-I/home/rhd/src/meson-test-app/3rdParty/dlib-18.16/.' '-MMD' '-MQ' 'meson-test@exe/main.cpp.o' '-MF' 'meson-test@exe/main.cpp.o.d' -o 'meson-test@exe/main.cpp.o' -c ../main.cppIs this the expected behavior?
$ ~/src/meson/meson.py -v0.26.0-researchit was just grabbed from github a week or so ago - 0728484ef77a8bcec542384abc0c7a82544e77ab
This is fixed in trunk now. Thanks for reporting it.