Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -41,6 +41,9 @@ option(LIBCXX_ENABLE_PEDANTIC "Compile with pedantic enabled." ON) option(LIBCXX_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF) option(LIBCXX_ENABLE_CXX0X "Enable -std=c++0x and use of c++0x language features if the compiler supports it." ON) +option(LIBCXX_ENABLE_CXX11 "Enable -std=c++11 and use of c++11 language features if the compiler supports it." ON) +option(LIBCXX_ENABLE_CXX1Y "Enable -std=c++1y and use of c++1y language features if the compiler supports it." ON) +option(LIBCXX_ENABLE_CXX1Z "Enable -std=c++1z and use of c++1z language features if the compiler supports it." OFF) option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON) option(LIBCXX_INSTALL_SUPPORT_HEADERS "Install libc++ support headers." ON) @@ -178,8 +181,17 @@ list(APPEND LIBCXX_CXX_REQUIRED_FLAGS -nostdinc++) string(REPLACE "-stdlib=libc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") endif() - if (LIBCXX_ENABLE_CXX0X AND LIBCXX_HAS_STDCXX0X_FLAG) - list(APPEND LIBCXX_CXX_REQUIRED_FLAGS -std=c++0x) + if (LIBCXX_ENABLE_CXX1Z AND LIBCXX_HAS_CXX1Z_FLAG) + set(LIBCXX_STD_FLAG -std=c++1z) + elseif(LIBCXX_ENABLE_CXX1Y AND LIBCXX_HAS_STDCXX1Y_FLAG) + set(LIBCXX_STD_FLAG -std=c++1y) + elseif(LIBCXX_ENABLE_CXX11 AND LIBCXX_HAS_CXX11_FLAG) + set(LIBCXX_STD_FLAG -std=c++11) + elseif (LIBCXX_ENABLE_CXX0X AND LIBCXX_HAS_STDCXX0X_FLAG) + set(LIBCXX_STD_FLAG -std=c++0x) + endif() + if (DEFINED LIBCXX_STD_FLAG) + list(APPEND LIBCXX_CXX_REQUIRED_FLAGS ${LIBCXX_STD_FLAG}) endif() endif() Index: cmake/config-ix.cmake =================================================================== --- cmake/config-ix.cmake +++ cmake/config-ix.cmake @@ -3,6 +3,9 @@ # Check compiler flags check_cxx_compiler_flag(-std=c++0x LIBCXX_HAS_STDCXX0X_FLAG) +check_cxx_compiler_flag(-std=c++11 LIBCXX_HAS_STDCXX11_FLAG) +check_cxx_compiler_flag(-std=c++1y LIBCXX_HAS_STDCXX1Y_FLAG) +check_cxx_compiler_flag(-std=c++1z LIBCXX_HAS_STDCXX1Z_FLAG) check_cxx_compiler_flag(-fPIC LIBCXX_HAS_FPIC_FLAG) check_cxx_compiler_flag(-nodefaultlibs LIBCXX_HAS_NODEFAULTLIBS_FLAG) check_cxx_compiler_flag(-nostdinc++ LIBCXX_HAS_NOSTDINCXX_FLAG) Index: test/CMakeLists.txt =================================================================== --- test/CMakeLists.txt +++ test/CMakeLists.txt @@ -28,7 +28,6 @@ set(LIBCXX_BINARY_DIR ${CMAKE_BINARY_DIR}) set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE}) pythonize_bool(LIBCXX_ENABLE_SHARED) - pythonize_bool(LIBCXX_HAS_STDCXX0X_FLAG) set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!") Index: test/lit.cfg =================================================================== --- test/lit.cfg +++ test/lit.cfg @@ -202,17 +202,12 @@ if libcxx_obj_root is None: libcxx_obj_root = libcxx_src_root -cxx_has_stdcxx0x_flag_str = lit_config.params.get('cxx_has_stdcxx0x_flag', None) -if cxx_has_stdcxx0x_flag_str is not None: - if cxx_has_stdcxx0x_flag_str.lower() in ('1', 'true'): - cxx_has_stdcxx0x_flag = True - elif cxx_has_stdcxx0x_flag_str.lower() in ('', '0', 'false'): - cxx_has_stdcxx0x_flag = False - else: - lit_config.fatal( - 'user parameter cxx_has_stdcxx0x_flag_str should be 0 or 1') -else: - cxx_has_stdcxx0x_flag = getattr(config, 'cxx_has_stdcxx0x_flag', True) +cxx_std_flag = lit_config.params.get('cxx_std_flag', None) +if cxx_std_flag is None: + cxx_std_flag = getattr(config, 'cxx_std_flag', None) +if not cxx_std_flag: + cxx_std_flag = '-std=c++0x' + lit_config.note("inferred cxx_std_flag as: %r" % (cxx_std_flag,)) # This test suite supports testing against either the system library or the # locally built one; the former mode is useful for testing ABI compatibility @@ -264,8 +259,8 @@ '-I' + libcxx_src_root + '/test/support'] library_paths = ['-L' + libcxx_obj_root + '/lib'] compile_flags = [] -if cxx_has_stdcxx0x_flag: - compile_flags += ['-std=c++0x'] +if cxx_std_flag: + compile_flags += [cxx_std_flag] # Configure extra linker parameters. exec_env = {} Index: test/lit.site.cfg.in =================================================================== --- test/lit.site.cfg.in +++ test/lit.site.cfg.in @@ -1,6 +1,6 @@ @AUTO_GEN_COMMENT@ config.cxx_under_test = "@LIBCXX_COMPILER@" -config.cxx_has_stdcxx0x_flag = @LIBCXX_HAS_STDCXX0X_FLAG@ +config.cxx_std_flag = "@LIBCXX_STD_FLAG@" config.libcxx_src_root = "@LIBCXX_SOURCE_DIR@" config.libcxx_obj_root = "@LIBCXX_BINARY_DIR@" config.python_executable = "@PYTHON_EXECUTABLE@"