stamen

Static Menu Generator
git clone git://git.dimitrijedobrota.com/stamen.git
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING |

commit92644eb864725cd28360172c93315e626f7b05e7
parentc169c53c39af25c773ebbbe13567cc32ffbd3e37
authorDimitrije Dobrota <mail@dimitrijedobrota.com>
dateMon, 24 Feb 2025 15:18:13 +0100

Resolve conflicts in new version of Cemplate

Diffstat:
M.clang-tidy|+
MCMakeLists.txt|++--
Msource/generate.cpp|+++++---

3 files changed, 8 insertions(+), 5 deletions(-)


diff --git a/.clang-tidy b/.clang-tidy

@@ -26,6 +26,7 @@ Checks: "*,\

-modernize-use-nodiscard,\
-modernize-use-trailing-return-type,\
-readability-function-cognitive-complexity,\
-misc-include-cleaner,\
-readability-magic-numbers
"
WarningsAsErrors: ''

diff --git a/CMakeLists.txt b/CMakeLists.txt

@@ -14,7 +14,7 @@ include(cmake/project-is-top-level.cmake)

include(cmake/variables.cmake)
find_package(poafloc 1.1 CONFIG REQUIRED)
find_package(cemplate 0.1.6 CONFIG REQUIRED)
find_package(cemplate 0.1.7 CONFIG REQUIRED)
# ---- Declare library ----

@@ -66,7 +66,7 @@ target_compile_features(stamen_stamen PUBLIC cxx_std_20)

add_executable(stamen_exe source/generate.cpp)
add_executable(stamen::exe ALIAS stamen_exe)
target_link_libraries(stamen_exe PUBLIC cemplate::cemplate)
target_link_libraries(stamen_exe PRIVATE cemplate::cemplate)
target_link_libraries(stamen_exe PRIVATE stamen::stamen)
set_property(TARGET stamen_exe PROPERTY OUTPUT_NAME stamen)

diff --git a/source/generate.cpp b/source/generate.cpp

@@ -34,6 +34,7 @@ auto accumulate_items(const stamen::menu_t& lmenu)

void generate_include(std::ostream& ost, const arguments_t& args)
{
using namespace std::string_literals; // NOLINT
using namespace cemplate; // NOLINT
ost << pragma_once();

@@ -70,13 +71,13 @@ public:

ost << "// generated function\n";
for (const auto& [code, _] : stamen::menu_lookup)
{
ost << func_decl(code, "int", {{"std::size_t", "/* unused */"}});
ost << func_decl(code, "int", {{{"std::size_t"s, "/* unused */"s}}});
}
ost << "\n// free function\n";
for (const auto& [code, _] : stamen::free_lookup)
{
ost << func_decl(code, "int", {{"std::size_t", "/* unused */"}});
ost << func_decl(code, "int", {{{"std::size_t"s, "/* unused */"s}}});
}
ost << nspace(args.nspace);

@@ -86,6 +87,7 @@ void generate_source(std::ostream& ost,

const arguments_t& args,
const std::string& include_name)
{
using namespace std::string_literals; // NOLINT
using namespace cemplate; // NOLINT
ost << include("cstddef");

@@ -102,7 +104,7 @@ void generate_source(std::ostream& ost,

ost << func(
menu.code(),
"extern int",
{{"std::size_t", "/* unused */"}}
{{{"std::size_t"s, "/* unused */"s}}}
)
<< decl("static const menu_t", "menu")
<< initlist({