Ignore undefined policies if QUIET is passed to dune_policy(SET)
If a Dune policy is not defined and a module calls dune_policy(SET)
with this policy, currently a fatal error is shown. This behavior makes it hard to write modules that support multiple dune versions. In particular, one needs to know in which dune version which policy is introduced. Unfortunately, a check like in CMake: if(POLICY <policy>)
cannot be implemented. One would need to provide a cmake function with an output parameter to check for the existence of a policy. This is also complicated to used.
There are two alternatives:
- Relax the
dune_policy(SET)
command, to accept undefined policies that are simply ignored. We could invert the logic and provide a global option to activate warnings about unset policies. - Provide an additional argument
QUIET
to the functiondune_policy(SET)
that suppresses the check for undefined policies and then simply does nothing. (This is proposed in this MR)
Which of the two alternatives should be implement?
Merge request reports
Activity
added buildsystem discussion labels
requested review from @santiago.ospina
assigned to @simon.praetorius
added 1 commit
- ba95797d - Test non-existent policy with QUIET argument
- Resolved by Santiago Ospina De Los Ríos
added 1 commit
- 258a61b6 - Replace the FATAL_ERROR in dune_policy(SET) by an author warning
LGTM. It would be nice to have this in 2.10 too. We have a new policy and not having a version guard on it produces a fatal error. This would allow modules that barely changed in 2.10 to still be compatible with previous core modules.
Edited by Santiago Ospina De Los Ríos
enabled an automatic merge when all merge checks for 258a61b6 pass
mentioned in commit a59cfc87
mentioned in merge request !1518 (merged)