This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new b8e0423b74 libcxx: Fix CMake compile with correct CMAKE_CXX_STANDARD
b8e0423b74 is described below

commit b8e0423b74c308633b521a628830ef853bcb6444
Author: Zhe Weng <[email protected]>
AuthorDate: Tue Jan 16 18:20:28 2024 +0800

    libcxx: Fix CMake compile with correct CMAKE_CXX_STANDARD
    
    It seems libcxx needs C++20 from 12.0.0 to 17.0.6: 
https://github.com/llvm/llvm-project/commit/3b625060fc91598d28196e559196bfc7b9a929f9
    
    But we're setting CMAKE_CXX_STANDARD to 17, errors on my side:
    
    nuttx/libs/libxx/libcxx/src/include/to_chars_floating_point.h:122:46: 
error: ‘bit_cast’ is not a member of ‘std’
      122 |     const _Uint_type _Uint_value    = 
_VSTD::bit_cast<_Uint_type>(_Value);
          |                                              ^~~~~~~~
    nuttx/libs/libxx/libcxx/src/memory_resource_init_helper.h:2:8: error: 
‘constinit’ does not name a type
        2 | static constinit ResourceInitHelper res_init 
_LIBCPP_INIT_PRIORITY_MAX;
          |        ^~~~~~~~~
    nuttx/libs/libxx/libcxx/src/memory_resource_init_helper.h:2:8: note: C++20 
‘constinit’ only available with ‘-std=c++20’ or ‘-std=gnu++20’
    
    Signed-off-by: Zhe Weng <[email protected]>
---
 libs/libxx/libcxx.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libs/libxx/libcxx.cmake b/libs/libxx/libcxx.cmake
index 0b4f019102..b20dbf724d 100644
--- a/libs/libxx/libcxx.cmake
+++ b/libs/libxx/libcxx.cmake
@@ -80,7 +80,7 @@ if(CONFIG_LIBSUPCXX)
   add_compile_definitions(__GLIBCXX__)
 endif()
 
-set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD 20)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
 set(SRCS)

Reply via email to