[CMake] Remove compilation flags for a given target

Florent Castelli florent.castelli at gmail.com
Tue Apr 9 11:43:48 EDT 2019


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 <borgogozo at antidot.net>
wrote:

> 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 solution for this particular problem.
> I find it strange that there is no way to remove properties from a
> target but it seems that it is really not possible...
>
> Thanks for you help!
>
> --
>  Benjamin Orgogozo
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190409/841c8fe3/attachment.html>


More information about the CMake mailing list