This is an archive of the discontinued LLVM Phabricator instance.

[lldb][CMake] Add LLDB_ENABLE_WERROR option
AbandonedPublic

Authored by sgraenitz on Aug 8 2019, 4:16 AM.

Details

Summary

Treat warnings as errors all over LLDB when enabled. Defaults to OFF.

Event Timeline

sgraenitz created this revision.Aug 8 2019, 4:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2019, 4:16 AM
Herald added a subscriber: mgorny. · View Herald Transcript
sgraenitz added inline comments.Aug 8 2019, 4:19 AM
lldb/cmake/modules/LLDBConfig.cmake
318

I copied the flag from LLVM. Is it the right one for MSVC?

labath added a comment.Aug 8 2019, 4:26 AM

So, why doesn't LLVM_ENABLE_WERROR suffice? It looks like that ought to work even in standalone builds...

sgraenitz abandoned this revision.Aug 8 2019, 6:34 AM

So, why doesn't LLVM_ENABLE_WERROR suffice? It looks like that ought to work even in standalone builds...

LLVM_ENABLE_WERROR affects the entire build tree. If another subproject causes a warning the build fails. In a way, you are right that this is sufficient, because the no-warnings policy seems to work well upstream.
The issue I was trying to solve is, that we can't use the setting with some external subprojects, because they are not strictly warning free. But then it may be better to have downstream. I agree.