From 1a0df950ebb9b763b3d132fb60f7f2e918adffe3 Mon Sep 17 00:00:00 2001 From: HanishKVC Date: Thu, 16 May 2024 14:46:18 +0530 Subject: [PATCH] C++17: Use and limit C++17 to common library for now C++17 provides a good enough variant as a standard feature, and chaton uses the same at its core, instead of rolling out its own struct of union based variant. And given that currently chaton is part of common library and not the base llama library, so limit the use of c++17 to common library. Initially while experimenting, had set the flag for full llama, limitting it for now. Also by now most embedded targets should be potentially having c++ compilers and libraries with support for c++17 features. So chances are it is a ok enough path to take. --- CMakeLists.txt | 2 -- common/CMakeLists.txt | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6840b23ec..feb6f39d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -849,8 +849,6 @@ function(get_flags CCID CCVER) set(GF_CXX_FLAGS ${CXX_FLAGS} PARENT_SCOPE) endfunction() -list(APPEND CXX_FLAGS -std=c++17) - if (LLAMA_FATAL_WARNINGS) if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") list(APPEND C_FLAGS -Werror) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index f34249532..8a6dbcd82 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -84,5 +84,5 @@ if (LLAMA_CURL) endif () target_include_directories(${TARGET} PUBLIC .) -target_compile_features(${TARGET} PUBLIC cxx_std_11) +target_compile_features(${TARGET} PUBLIC cxx_std_17) target_link_libraries(${TARGET} PRIVATE ${LLAMA_COMMON_EXTRA_LIBS} PUBLIC llama)