Skip to content

Commit 03b7c4d

Browse files
author
Kostya Kortchinsky
committed
[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 llvm-svn: 331042
1 parent d175476 commit 03b7c4d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/runtimes/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
109109

110110
# Avoid checking whether the compiler is working.
111111
set(LLVM_COMPILER_CHECKED ON)
112+
# Enable warnings, otherwise -w gets added to the cflags by HandleLLVMOptions
113+
# resulting in unjustified successes by check_cxx_compiler_flag.
114+
set(LLVM_ENABLE_WARNINGS ON)
112115

113116
# Handle common options used by all runtimes.
114117
include(AddLLVM)

0 commit comments

Comments
 (0)