1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

CMake : optionaly enable LLVM to be compiled with -std=c++11 (default: off)

In some case, it may be required to build LLVM in C++11 mode, as some the subprojects (like lldb) requires it.

This mimics the autoconf behaviour.

However, given the discussions on the switch to C++11 of the codebase, this behaviour should evolve to default to C++11 with some checks of the compiler capabilities.

llvm-svn: 195727
This commit is contained in:
Arnaud A. de Grandmaison 2013-11-26 10:33:53 +00:00
parent 5be5f8d16c
commit d7bbd2a889
3 changed files with 8 additions and 0 deletions

View File

@ -179,6 +179,7 @@ else( MSVC )
option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON) option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON)
endif() endif()
option(LLVM_ENABLE_CXX11 "Compile with C++11 enabled." OFF)
option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON) option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
option(LLVM_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF) option(LLVM_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)

View File

@ -246,6 +246,10 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
if (LLVM_ENABLE_WERROR) if (LLVM_ENABLE_WERROR)
add_llvm_definitions( -Werror ) add_llvm_definitions( -Werror )
endif (LLVM_ENABLE_WERROR) endif (LLVM_ENABLE_WERROR)
if (LLVM_ENABLE_CXX11)
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)
endif( MSVC ) endif( MSVC )
macro(append_common_sanitizer_flags) macro(append_common_sanitizer_flags)

View File

@ -211,6 +211,9 @@ LLVM-specific variables
**LLVM_ENABLE_THREADS**:BOOL **LLVM_ENABLE_THREADS**:BOOL
Build with threads support, if available. Defaults to ON. Build with threads support, if available. Defaults to ON.
**LLVM_ENABLE_CXX11**:BOOL
Build in C++11 mode, if available. Defaults to OFF.
**LLVM_ENABLE_ASSERTIONS**:BOOL **LLVM_ENABLE_ASSERTIONS**:BOOL
Enables code assertions. Defaults to OFF if and only if ``CMAKE_BUILD_TYPE`` Enables code assertions. Defaults to OFF if and only if ``CMAKE_BUILD_TYPE``
is *Release*. is *Release*.