automoc: avoid compiler warnings in linker-warning-silencing code
requested to merge tsdgeos/cmake:less_warnings_in_cmake_automoc_silence_linker_warning_v2 into master
Revise the code added by !7296 (merged) (merged). Make cmake_automoc_silence_linker_warning less warning-y. Fix weak-tables clang warning and copyable-polymorph clazy warning.
Fixes: #23823 (closed)
Backport: release
Topic-rename: automoc-silence-warnings
Edited by Brad King