Re: [CMake] Remove compilation flags for a given target

2019-04-09 Thread Florent Castelli
I believe that your targets should be using something like: target_compile_options(yourlib PRIVATE -Wwhatever) They will be built with said warnings, but it won't be propagated to consumers of the library. So you shouldn't have to remove anything. On Tue, Apr 9, 2019 at 8:47 AM Benjamin Orgogozo

Re: [CMake] Remove compilation flags for a given target

2019-04-09 Thread Benjamin Orgogozo
On Fri, Apr 05, 2019 at 07:56:25PM -0700, Marc Herbert wrote: >Instead of removing, have you tried appending the -Wno-fubar flag that >turns back off these >specific warnings for these specific files? Ah, yes, it will actually work... Not the answer that I was expecting but clearly a

Re: [CMake] Remove compilation flags for a given target

2019-04-09 Thread Benjamin Orgogozo
On Thu, Apr 04, 2019 at 06:00:43PM +0200, Mateusz Loskot wrote: > The list should rather be, in preference/priority order > > 1. https://cmake.org/cmake/help/latest/command/target_compile_options.html > 2. add_compile_options Yes, it's what I understood from documentation. > Are you certain

Re: [CMake] Remove compilation flags for a given target

2019-04-05 Thread Marc Herbert
> > > in our code base we would like to add a warning compilation flags. > Nevertheless, this flag prevents us from compiling a few targets so we > would like to remove this flag for the given targets. > > Since I don't want to *add* a compilation flags but remove one, I would > like to retrieve

Re: [CMake] Remove compilation flags for a given target

2019-04-04 Thread Mateusz Loskot
On Thu, 4 Apr 2019 at 14:47, Benjamin Orgogozo wrote: > > If I'm right (I'm far from being a cmake expert) there are two ways to > define "global" compilation flags: > 1- set the CXX_COMPILE_FLAGS variable; > 2- use add_compile_options($<$:-WMyFavouriteWarning). The list should rather be, in

[CMake] Remove compilation flags for a given target

2019-04-04 Thread Benjamin Orgogozo
Hello, in our code base we would like to add a warning compilation flags. Nevertheless, this flag prevents us from compiling a few targets so we would like to remove this flag for the given targets. If I'm right (I'm far from being a cmake expert) there are two ways to define "global"