llvm.org GIT mirror llvm / bd3f6f8
[CMake] Enable warnings for runtimes Summary: `HandleLLVMOptions` adds `-w` to the cflags if `LLVM_ENABLE_WARNINGS` is not on. With `-w`, `check_cxx_compiler_flag` doesn't error out for unsupported flags (for example `-mcrc` on x86_64), and those flags end up being detected as working - and really they aren't. I am not entirely sure what the best way to solve this is, but setting `LLVM_ENABLE_WARNINGS` prior to including `HandleLLVMOptions` does the job. Reviewers: phosek, beanz Reviewed By: phosek Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D46079 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331042 91177308-0d34-0410-b5e6-96231b3b80d8 Kostya Kortchinsky 1 year, 5 months ago
1 changed file(s) with 3 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
108108
109109 # Avoid checking whether the compiler is working.
110110 set(LLVM_COMPILER_CHECKED ON)
111 # Enable warnings, otherwise -w gets added to the cflags by HandleLLVMOptions
112 # resulting in unjustified successes by check_cxx_compiler_flag.
113 set(LLVM_ENABLE_WARNINGS ON)
111114
112115 # Handle common options used by all runtimes.
113116 include(AddLLVM)