diff --git a/.gitignore b/.gitignore index 58e8fb4..eeab95e 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ cmake/CPM.cmake cpm-package-lock.cmake include/openssl include/tls.h +libcserver_shared.so +libcserver_static.a diff --git a/CMakeLists.txt b/CMakeLists.txt index b7c3c56..4492d78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,7 @@ set(CXX_EXTENSIONS NO) set(Boost_USE_MULTITHREADED ON) set(BOOST_NOT_HEADER_ONLY_COMPONENTS_THAT_YOU_NEED "url;program_options") set(BOOST_HEADER_ONLY_COMPONENTS_THAT_YOU_NEED "asio;pfr") +set(UTEMPL_MODULE OFF) set(TRY_BOOST_VERSION "1.85.0") set(BOOST_INCLUDE_LIBRARIES "${BOOST_NOT_HEADER_ONLY_COMPONENTS_THAT_YOU_NEED};${BOOST_HEADER_ONLY_COMPONENTS_THAT_YOU_NEED}" @@ -14,6 +15,7 @@ set(BOOST_INCLUDE_LIBRARIES option(CPM_USE_LOCAL_PACKAGES "Use local packages" ON) option(CSERVER_USE_LIBRESSL "Use LibreSSL" OFF) +option(UTEMPL_USE_LOCAL_PACKAGE "Use utempl local package" OFF) file( DOWNLOAD @@ -69,11 +71,16 @@ CPMAddPackage( endif() +set(TMP ${CPM_USE_LOCAL_PACKAGES}) +set(CPM_USE_LOCAL_PACKAGES ${UTEMPL_USE_LOCAL_PACKAGE}) + CPMAddPackage( NAME utempl URL "https://github.com/linuxnyasha/utempl/archive/refs/heads/main.zip" + EXCLUDE_FROM_ALL ON OPTIONS "ENABLE_TESTS OFF" "ENABLE_EXAMPLES OFF" ) +set(CPM_USE_LOCAL_PACKAGES ${TMP}) diff --git a/examples/src/cli.cpp b/examples/src/cli.cpp index e3301a4..46ea92a 100644 --- a/examples/src/cli.cpp +++ b/examples/src/cli.cpp @@ -5,7 +5,7 @@ struct SomeStruct { static_assert(utempl::OpenStruct()); - utempl::FieldAttribute> field; + utempl::FieldAttribute>> field; static_assert(utempl::CloseStruct()); }; diff --git a/include/cserver/components/cli/manager.hpp b/include/cserver/components/cli/manager.hpp index 23a1c1f..4ca1eda 100644 --- a/include/cserver/components/cli/manager.hpp +++ b/include/cserver/components/cli/manager.hpp @@ -78,7 +78,7 @@ struct Manager { if(this->variableMap.count(name.begin())) { return this->variableMap[name.begin()].template as(); }; - throw std::runtime_error(fmt::format("Not found cli option {}", name)); + throw std::runtime_error(fmt::format("Not found cli option {}", name.begin())); }()...}; } | utempl::kSeq>; };