[PATCH] D46079: [CMake] Enable warnings for runtimes
Kostya Kortchinsky via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 25 13:53:22 PDT 2018
cryptoad created this revision.
cryptoad added reviewers: phosek, beanz.
Herald added a subscriber: mgorny.
`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.
Repository:
rL LLVM
https://reviews.llvm.org/D46079
Files:
runtimes/CMakeLists.txt
Index: runtimes/CMakeLists.txt
===================================================================
--- runtimes/CMakeLists.txt
+++ runtimes/CMakeLists.txt
@@ -109,6 +109,9 @@
# Avoid checking whether the compiler is working.
set(LLVM_COMPILER_CHECKED ON)
+ # Enable warnings, otherwise -w gets added to the cflags by HandleLLVMOptions
+ # resulting in unjustified successes by check_cxx_compiler_flag.
+ set(LLVM_ENABLE_WARNINGS ON)
# Handle common options used by all runtimes.
include(AddLLVM)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46079.143998.patch
Type: text/x-patch
Size: 515 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180425/bbe529f8/attachment.bin>
More information about the llvm-commits
mailing list