Skip to content
Snippets Groups Projects

Ignore undefined policies if QUIET is passed to dune_policy(SET)

Merged Simon Praetorius requested to merge cmake/set-policy-quiet into master
1 unresolved thread

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:

  1. 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.
  2. Provide an additional argument QUIET to the function dune_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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 1 commit

    • 258a61b6 - Replace the FATAL_ERROR in dune_policy(SET) by an author warning

    Compare with previous version

  • resolved all threads

  • Santiago Ospina De Los Ríos approved this merge request

    approved this merge request

  • Simon Praetorius marked this merge request as ready

    marked this merge request as ready

  • Simon Praetorius enabled an automatic merge when all merge checks for 258a61b6 pass

    enabled an automatic merge when all merge checks for 258a61b6 pass

  • mentioned in commit a59cfc87

  • Simon Praetorius mentioned in merge request !1518 (merged)

    mentioned in merge request !1518 (merged)

  • Please register or sign in to reply
    Loading