gz-cmake icon indicating copy to clipboard operation
gz-cmake copied to clipboard

CMake Flag to Skip Deprecated Tests or Functionality

Open mjcarroll opened this issue 3 years ago • 2 comments

Desired behavior

Add a CMake flag which would allow a user to skip tests of deprecated functionality, or to skip building/installing the deprecated functionality entirely.

As we continue to develop the ignition stack, there will naturally be some features that will be deprecated over time as they get relocated or overtaken by other functionality. We already have the ability to mark these via the generated Export.hh headers generated via ign-cmake.

This feature would introduce a similar concept to mark these things at the CMake level. The primary use cases I can think of:

  1. In a source-built workspace, I want to make sure that nothing downstream is depending on a deprecated feature. Rather than warning, turning off building/installing deprecated functions will cause compilation failures. This can also be helpful in catching places where a deprecation warning isn't sufficient (eg a macro or erroneously-included detail header)

  2. In a source-built workspace, I want to skip building and testing all deprecated functionality to save some cycles.

I would propose two flags:

  • SKIP_DEPRECATED_TESTS: Skip building and executing tests against deprecated functionality
  • SKIP_DEPRECATED: Skip building and testing all deprecated functionality in a library.

Note, I am proposing these flags are left OFF in CI builds so that we can guarantee that we aren't regressing. This is primarily for developer quality-of-life.

mjcarroll avatar Jan 25 '22 21:01 mjcarroll