f0rmiga / gcc-toolchain

A fully-hermetic Bazel GCC toolchain for Linux.
Apache License 2.0
103 stars 24 forks source link

[FR]: can copts come after extra_cxxflags? #154

Open ghorn opened 11 months ago

ghorn commented 11 months ago

What is the current behavior?

We are adding a large set of warning flags with extra_cxxflags and extra_cflags. I just tried to disable a warning locally in a cc_library with with copts = ["-Wno-foo"], and it surprisingly didn't work. I built with bazel build -s and saw that the compiler invocation adds the extra_cxxflags after the flags from copts. This means that one cannot disable any flag from extra_cxxflags locally in a cc_library.

Was it intentional to do it this way or was that just how it was set up?

Describe the feature

If it makes sense, then the feature would be to swap the order of extra_cxxflags and copts. (Same for extra_cflags).