cmTargetPropCommandBase::ArgumentFlags enum values not boolean OR'able
The cmTargetPropCommandBase::ArgumentFlags
enum has acquired more values over recent releases. Initially, it had just these values:
enum ArgumentFlags
{
NO_FLAGS = 0,
PROCESS_BEFORE = 1,
PROCESS_SYSTEM = 2
};
All three of those values could be OR'ed to indicate which specific arguments were supported. Expressions like flags & PROCESS_SYSTEM
could then be used to work out whether a particular argument was present and valid. Commits 729d997f (from !3762 (merged)) and b68699b7 (from !5633 (merged)) subsequently added two more values, but the values assigned in both cases broke this ability to use such boolean logic. The enum is now defined as follows:
enum ArgumentFlags
{
NO_FLAGS = 0x0,
PROCESS_BEFORE = 0x1,
PROCESS_AFTER = 0x2,
PROCESS_SYSTEM = 0x3,
PROCESS_REUSE_FROM = 0x4
};
The PROCESS_SYSTEM
value is now the same as PROCESS_BEFORE | PROCESS_AFTER
. This means code like the following no longer gets detected as an error:
target_compile_options(someTarget SYSTEM PRIVATE ...)
The enum values should be increasing powers of 2, not incremented by 1 each time:
enum ArgumentFlags
{
NO_FLAGS = 0x0,
PROCESS_BEFORE = 0x1,
PROCESS_AFTER = 0x2,
PROCESS_SYSTEM = 0x4,
PROCESS_REUSE_FROM = 0x8
};