From 1b44db22c6e378080539a35ce1fd1f9b1f85c9b1 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Sat, 16 Aug 2014 01:35:36 +0000 Subject: [libcxx] Update the way the -std= flag is chosen by CMake and LibcxxTestFormat Summary: This patch does two things: CMake Update: - Add compiler flag checks for -std=c++11 and -std=c++1y and remove check for -std=c++0x. - Add configuration option LIBCXX_ENABLE_CXX1Y to prevent/allow -std=c++1y from being chosen as the std version. LIBCXX_ENABLE_CXX1Y is set to OFF by default. - if LIBCXX_ENABLE_CXX1Y is enabled then set LIBCXX_STD_VERSION to c++1y and fail if the compiler does not support -std=c++1y - If c++1y is not enabled then use c++11 and fail if the compiler does not support c++11. Lit Update: - Update lit.site.cfg.in to capture LIBCXX_STD_VERSION information as config.std. - Remove mentions of has_cxx0X configuration option. - Check for `--param std=X' passed to lit on the command line. - Choose the std for the tests either from command line parameter or (if it doesn't exist) the lit.site.cfg. Reviewers: mclow.lists, danalbert Reviewed By: danalbert Subscribers: emaste, rnk, ajwong, danalbert, cfe-commits Differential Revision: http://reviews.llvm.org/D4329 llvm-svn: 215802 --- libcxx/cmake/config-ix.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libcxx/cmake') diff --git a/libcxx/cmake/config-ix.cmake b/libcxx/cmake/config-ix.cmake index e8adafd6587..6aa4fa2da75 100644 --- a/libcxx/cmake/config-ix.cmake +++ b/libcxx/cmake/config-ix.cmake @@ -2,7 +2,8 @@ include(CheckLibraryExists) include(CheckCXXCompilerFlag) # 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(-fPIC LIBCXX_HAS_FPIC_FLAG) check_cxx_compiler_flag(-nodefaultlibs LIBCXX_HAS_NODEFAULTLIBS_FLAG) check_cxx_compiler_flag(-nostdinc++ LIBCXX_HAS_NOSTDINCXX_FLAG) -- cgit v1.2.3