From 5331803ecda833faf3fde86c0ecef6e5e47386e9 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sat, 16 Sep 2023 17:04:29 +0200 Subject: [PATCH] cxx11: deprecate and use cxx-standard --- cxx11.cmake | 40 ++++++---------------------------------- 1 file changed, 6 insertions(+), 34 deletions(-) diff --git a/cxx11.cmake b/cxx11.cmake index 1be7fd60e..a3b623d8d 100644 --- a/cxx11.cmake +++ b/cxx11.cmake @@ -13,44 +13,16 @@ # You should have received a copy of the GNU General Public License along with # this program. If not, see . -include(CheckCXXCompilerFlag) - -# .rst: .. ifmode:: user -# -# .. command:: CHECK_CXX11_SUPPORT -# -# Set ouput variable CXX11_SUPPORTED to TRUE if C++11 is supported by the -# current compiler. Set to FALSE otherwise. -# -function(CHECK_CXX11_SUPPORT CXX11_SUPPORTED) - check_cxx_compiler_flag("-std=c++0x" COMPILER_SUPPORTS_CXX0X) - check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11) - - if(COMPILER_SUPPORTS_CXX0X OR COMPILER_SUPPORTS_CXX11) - set(${CXX11_SUPPORTED} - TRUE - PARENT_SCOPE) - else() - set(${CXX11_SUPPORTED} - FALSE - PARENT_SCOPE) - endif() -endfunction(CHECK_CXX11_SUPPORT) - # .rst: .. ifmode:: user # # .. command:: PROJECT_USE_CXX11 # -# This macro set up the project to compile the whole project with C++11 -# standards. +# DEPRECATED. This macro set up the project to compile the whole project with +# C++11 standards. # macro(PROJECT_USE_CXX11) - check_cxx_compiler_flag("-std=c++0x" COMPILER_SUPPORTS_CXX0X) - check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11) - if(COMPILER_SUPPORTS_CXX0X OR COMPILER_SUPPORTS_CXX11) - set(CMAKE_CXX_STANDARD 11) - set(CXX_STANDARD_REQUIRED ON) - else() - message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support.") - endif() + message( + DEPRECATION + "This macro is deprecated. Use CHECK_MINIMAL_CXX_STANDARD instead.") + check_minimal_cxx_standard(11 REQUIRED) endmacro(PROJECT_USE_CXX11)