llvm.org GIT mirror llvm / b23750a
[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 Chandler Carruth 5 years ago
2 changed file(s) with 11 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
197197 option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON)
198198 endif()
199199
200 option(LLVM_ENABLE_CXX11 "Compile with C++11 enabled." ON)
200 option(LLVM_ENABLE_CXX1Y "Compile with C++1y enabled." OFF)
201201 option(LLVM_ENABLE_LIBCXX "Use libc++ if available." OFF)
202202 option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
203203 option(LLVM_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
286286 if (LLVM_ENABLE_WERROR)
287287 add_llvm_definitions( -Werror )
288288 endif (LLVM_ENABLE_WERROR)
289 if (LLVM_ENABLE_CXX11)
289 if (LLVM_ENABLE_CXX1Y)
290 check_cxx_compiler_flag("-std=c++1y" CXX_SUPPORTS_CXX1Y)
291 append_if(CXX_SUPPORTS_CXX1Y "-std=c++1y" CMAKE_CXX_FLAGS)
292 else()
290293 check_cxx_compiler_flag("-std=c++11" CXX_SUPPORTS_CXX11)
291 append_if(CXX_SUPPORTS_CXX11 "-std=c++11" CMAKE_CXX_FLAGS)
292 endif (LLVM_ENABLE_CXX11)
294 if (CXX_SUPPORTS_CXX11)
295 append("-std=c++11" CMAKE_CXX_FLAGS)
296 else()
297 message(FATAL_ERROR "LLVM requires C++11 support but the '-std=c++11' flag isn't supported.")
298 endif()
299 endif()
293300 endif( MSVC )
294301
295302 macro(append_common_sanitizer_flags)