Skip to content

cmake: Remove broken '--warn-unused-vars' option

Brad King requested to merge brad.king/cmake:remove-warn-unused-vars into master

This option has been broken since commit b9f99155 (CMake 3.3). That commit removed the check that an initialized variable has actually been used and caused the option to warn on every variable ever set. This was not caught by the test suite because the test for the feature only checked that warnings appear when needed and not that they do not appear when not needed.

The option was never very practical to use. Remove it to avoid the runtime cost of usage tracking and checks for every variable (which we were doing even when the option was not used).

Edited by Brad King

Merge request reports