[cmake] Require C++14 for building IWYU
The LLVM headers require -std=c++14 to parse and several compilers are not C++14 by default. IWYU itself currently only needs C++11, but LLVM does not announce its minimum required C++ standard anywhere in its CMake config, so open up for C++14 in IWYU by specifying it explicitly. Fixes #867 and #880.
This commit is contained in:
parent
75cb6d99ec
commit
c5f3b0fe4c
|
@ -93,6 +93,11 @@ add_llvm_executable(include-what-you-use
|
|||
# available when IWYU is executed from the build dir.
|
||||
add_dependencies(include-what-you-use clang-resource-headers)
|
||||
|
||||
# LLVM requires C++14, so follow suit.
|
||||
set_property(TARGET include-what-you-use PROPERTY CXX_STANDARD_REQUIRED ON)
|
||||
set_property(TARGET include-what-you-use PROPERTY CXX_STANDARD 14)
|
||||
set_property(TARGET include-what-you-use PROPERTY CXX_EXTENSIONS OFF)
|
||||
|
||||
if (MINGW)
|
||||
# Work around 'too many sections' error with MINGW/GCC
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj")
|
||||
|
|
Loading…
Reference in New Issue