Enable LLVM_ENABLE_WARNINGS when building standalone out of tree

When built within the llvm runtimes directory, the runtimes
CMakeLists.txt adds the same.

Differential Revision: https://reviews.llvm.org/D56981

llvm-svn: 351875
This commit is contained in:
Martin Storsjo 2019-01-22 20:50:33 +00:00
parent a13edd3ef2
commit 495c3d3c90
1 changed files with 2 additions and 0 deletions

View File

@ -73,6 +73,8 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
endif()
if (EXISTS ${LLVM_CMAKE_PATH})
# Enable warnings, otherwise -w gets added to the cflags by HandleLLVMOptions.
set(LLVM_ENABLE_WARNINGS ON)
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
include("${LLVM_CMAKE_PATH}/AddLLVM.cmake")
include("${LLVM_CMAKE_PATH}/HandleLLVMOptions.cmake")