fprime
fprime copied to clipboard
Add static assertions for dependent F Prime flags
Copied from https://github.com/fprime-community/fpp/issues/303, since this is a framework issue.
Some combinations of settings of F Prime flags will cause the generated code to fail to compile. To assist the user, we should add static assertions that check for these conditions and provide clear error messages.
Known dependencies:
- If
BUILD_UT
is on,FW_SERIALIZABLE_TO_STRING
andFW_ARRAY_TO_STRING
must also be on -
FW_SERIALIZABLE_TO_STRING
andFW_ARRAY_TO_STRING
are dependent in the following cases:- If an array containing structs is defined and
FW_ARRAY_TO_STRING
is on, thenFW_SERIALIZABLE_TO_STRING
must also be on - If a struct containing arrays is defined and
FW_SERIALIZABLE_TO_STRING
is on, thenFW_ARRAY_TO_STRING
must also be on
- If an array containing structs is defined and
We should also consider auto-defining FW_ARRAY_TO_STRING and FW_SERIALIZABLE_TO_STRING to 1 on the command line when building unit tests. This would make it easier for users.
Also, we should merge FW_ARRAY_TO_STRING and FW_SERIALIZABLE_TO_STRING into the same condition. This is an FPP issue. See https://github.com/fprime-community/fpp/issues/375.