From f2c611005824f98a27eea8f792d1ec7f589dcfd0 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Sun, 18 Oct 2026 17:46:49 -0400 Subject: [PATCH] Now have a basic cli for it. --- Makefile | 19 ++++++++----------- meson.build | 18 ++++++++++++++---- src/main.cpp | 6 ++++++ 3 files changed, 28 insertions(+), 15 deletions(-) create mode 100644 src/main.cpp diff --git a/Makefile b/Makefile index 0e7fb21..2457586 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -all: build test_perf +all: test reset: ifeq '$(OS)' 'Windows_NT' @@ -18,28 +18,25 @@ debug_build: meson setup --wipe builddir -Db_ndebug=true --buildtype debugoptimized meson compile -j 10 -C builddir -test_perf: build - ./builddir/sol2_test -m "perf" - test: build - ./builddir/sol2_test + ./builddir/bezos_tests run: build test ifeq '$(OS)' 'Windows_NT' - powershell "cp ./builddir/sol2_test.exe ." - ./sol2_test + powershell "cp ./builddir/bezos.exe ." + ./bezos else - ./builddir/sol2_test + ./builddir/bezos endif debug: build - gdb --nx -x .gdbinit --ex run --args builddir/sol2_test + gdb --nx -x .gdbinit --ex run --args builddir/bezos_tests debug_run: build - gdb --nx -x .gdbinit --batch --ex run --ex bt --ex q --args builddir/sol2_test + gdb --nx -x .gdbinit --batch --ex run --ex bt --ex q --args builddir/bezos_tests clean: meson compile --clean -C builddir debug_test: build - gdb --nx -x .gdbinit --ex run --args builddir/sol2_test -e + gdb --nx -x .gdbinit --ex run --args builddir/bezos_tests -e diff --git a/meson.build b/meson.build index f570629..0f5466f 100644 --- a/meson.build +++ b/meson.build @@ -25,17 +25,27 @@ sol2 = subproject('sol2').get_variable('sol2_dep') dependencies = [fmt, fuc2, sol2] sources = [ - 'tests/sol2_test.cpp', - 'tests/builder_test.cpp', 'src/stats.cpp', - 'tests/main.cpp', 'src/dbc.cpp', 'src/builder.cpp', 'src/bezos.cpp', 'src/document.cpp', ] -executable('sol2_test', sources, +tests = [ + 'tests/main.cpp', + 'tests/sol2_test.cpp', + 'tests/builder_test.cpp', +] + +executable('bezos_tests', sources + tests, + cpp_args: cpp_args, + link_args: link_args, + include_directories: include_directories('src'), + override_options: exe_defaults, + dependencies: dependencies) + +executable('bezos', sources + ['src/main.cpp'], cpp_args: cpp_args, link_args: link_args, include_directories: include_directories('src'), diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..18ccce3 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,6 @@ +#include "bezos.hpp" + +int main(int argc, char *argv[]) { + Deck deck = Bezos::load("lua/builder_test.lua"); + Bezos::dump(deck); +}