Drake provides mechanisms to control the severity of deprecated API usage at both compile time and at runtime.
To promote compile-time deprecation warnings to errors, build with -Werror=deprecated-declarations. To silence them, define the preprocessor symbol DRAKE_DEPRECATION_IS_SILENT.
Bazel (add to .bazelrc):
CMake:
Runtime deprecation warnings can be controlled via the DRAKE_DEPRECATION_RUNTIME_SEVERITY environment variable:
Setting the variable to an unrecognized value causes a one-time warning and falls back to the default behavior.
This setting governs all Python deprecation warnings, and a small percentage of C++ deprecation warnings that cannot be expressed at compile-time.