diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-03-01 03:16:07 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-03-01 03:16:07 +0000 |
commit | b23750a8ae1628d98d6b0ad0ec3e975a3c42863b (patch) | |
tree | 8d427bb522989c8818c2d5e790d9dfe9834dfc2c /cmake | |
parent | f468dea807ee7350ba9814ebda0047e97738aba0 (diff) | |
download | llvm-b23750a8ae1628d98d6b0ad0ec3e975a3c42863b.tar.gz llvm-b23750a8ae1628d98d6b0ad0ec3e975a3c42863b.tar.bz2 llvm-b23750a8ae1628d98d6b0ad0ec3e975a3c42863b.tar.xz |
[C++11] Switch the CMake option from LLVM_ENABLE_CXX11 (default on) to
LLVM_ENABLE_CXX1Y (default *off*). =D C++98 is dead. Long live C++11.
I don't exactly recommend using C++1y just yet though...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202567 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/HandleLLVMOptions.cmake | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake index f132803b55..ccf5f90f17 100644 --- a/cmake/modules/HandleLLVMOptions.cmake +++ b/cmake/modules/HandleLLVMOptions.cmake @@ -287,10 +287,17 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE ) if (LLVM_ENABLE_WERROR) add_llvm_definitions( -Werror ) endif (LLVM_ENABLE_WERROR) - if (LLVM_ENABLE_CXX11) + if (LLVM_ENABLE_CXX1Y) + check_cxx_compiler_flag("-std=c++1y" CXX_SUPPORTS_CXX1Y) + append_if(CXX_SUPPORTS_CXX1Y "-std=c++1y" CMAKE_CXX_FLAGS) + else() check_cxx_compiler_flag("-std=c++11" CXX_SUPPORTS_CXX11) - append_if(CXX_SUPPORTS_CXX11 "-std=c++11" CMAKE_CXX_FLAGS) - endif (LLVM_ENABLE_CXX11) + if (CXX_SUPPORTS_CXX11) + append("-std=c++11" CMAKE_CXX_FLAGS) + else() + message(FATAL_ERROR "LLVM requires C++11 support but the '-std=c++11' flag isn't supported.") + endif() + endif() endif( MSVC ) macro(append_common_sanitizer_flags) |