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.
This commit is contained in:
HanishKVC 2024-05-16 14:46:18 +05:30
parent 239b5be219
commit 1a0df950eb
2 changed files with 1 additions and 3 deletions

View file

@ -849,8 +849,6 @@ function(get_flags CCID CCVER)
set(GF_CXX_FLAGS ${CXX_FLAGS} PARENT_SCOPE) set(GF_CXX_FLAGS ${CXX_FLAGS} PARENT_SCOPE)
endfunction() endfunction()
list(APPEND CXX_FLAGS -std=c++17)
if (LLAMA_FATAL_WARNINGS) if (LLAMA_FATAL_WARNINGS)
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
list(APPEND C_FLAGS -Werror) list(APPEND C_FLAGS -Werror)

View file

@ -84,5 +84,5 @@ if (LLAMA_CURL)
endif () endif ()
target_include_directories(${TARGET} PUBLIC .) 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) target_link_libraries(${TARGET} PRIVATE ${LLAMA_COMMON_EXTRA_LIBS} PUBLIC llama)