The previous diff D3792 made the add_linker_flag method able to catch
unused link flags, preventing their addition.
The following diff D3802 broke the feature while refactoring the code.
Adding the warning is not enough, it should be promoted to an error.
This diff restores the previous (correct) behavior.