Page MenuHome

CMake: support per-library cflags
ClosedPublic

Authored by Campbell Barton (campbellbarton) on Jul 13 2016, 8:11 AM.

Details

Summary

Support CMAKE_C_FLAGS, CMAKE_CXX_FLAGS for individual libraries.

This is intended as a developer only feature, where maintainers of modules can add cflags that only apply to that module.

The patch will check CMAKE_C_FLAGS_${name}, CMAKE_CXX_FLAGS_${name} and use them if they're defined.

So if you want to add extra flags to BMesh for example, define CMAKE_C_FLAGS_BF_BMESH in the CMakeCache.txt.

This means a developer could use some strict warnings but add exceptions for libraries where its not useful.

Submitting for feedback, can include if its handy.

Diff Detail

Repository
rB Blender
Branch
TEMP-CMAKE-LIBRARY-FLAGS
Build Status
Buildable 9
Build 9: arc lint + arc unit

Event Timeline

Bastien Montagne (mont29) edited edge metadata.

LGTM, and can be useful dev feature indeed.

This revision is now accepted and ready to land.Jul 13 2016, 9:13 AM