add_definitions: add a policy to deprecate the command
Having just looked at the implementation, add_definitions
is basically just a generic flag smuggler. It does special things for -D
flags, but other than that, it just splats flags into the command line (in the definitions location). I'll also note that there is some "massaging" of its arguments that is completely undocumented (replacing newlines with spaces).
remove_definitions
should also go away. Namely, it doesn't support grouped flags.
add_definitions(-Xarch_x86_64 -mavx512)
remove_definitions(-Xarch_x86_64) # `-mavx512` is now "naked"
Cc: @brad.king