From 3be46c12b8b9fca33819ad9f835c98c8b1f72c7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rard?= Date: Fri, 1 May 2026 19:42:28 +0200 Subject: [PATCH] =?UTF-8?q?Modification=20des=20r=C3=A8gles=20de=20cmake?= =?UTF-8?q?=5Fpolicy()=20SwigNode=20ne=20peut=20toujours=20pas=20=C3=AAtre?= =?UTF-8?q?=20compil=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b3a62e8..f36b275 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required (VERSION 4.0) project (mraa C) cmake_policy(SET CMP0177 NEW) -#cmake_policy(SET CMP0148 NEW) +cmake_policy(SET CMP0148 NEW) FIND_PACKAGE (Threads REQUIRED) @@ -78,17 +78,22 @@ if (BUILDCPP) endif () endforeach () + #----------------------------------------------------------------- # This function adds the c++20 flag to a c++ target (if supported) - function(use_cxx_20 targetname) + #function(use_cxx_20 targetname) + message(STATUS "\nInside function") include(CheckCXXCompilerFlag) - CHECK_CXX_COMPILER_FLAG("-std=c++20" COMPILER_SUPPORTS_CXX20) + CHECK_CXX_COMPILER_FLAG(-std=c++23 COMPILER_SUPPORTS_CXX20) + message(STATUS "check result ${COMPILER_SUPPORTS_CXX20}") if (COMPILER_SUPPORTS_CXX20) - set_target_properties(${targetname} PROPERTIES COMPILE_FLAGS "-std=c++20") - message(STATUS "INFO Use std=c++20") + set_target_properties(${targetname} PROPERTIES COMPILE_FLAGS "-std=c++23") + message(STATUS "INFO Use std=c++23") else() message(FATAL_ERROR "Target '${targetname}' requires c++20 which is not supported by this compiler") endif() - endfunction() + #endfunction() + #------------------------------------------------------------------ + # # This function adds the c++17 flag to a c++ target (if supported) # function(use_cxx_17 targetname)