diff --git a/CMakeLists.txt b/CMakeLists.txt index fe605bf..d19b92f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,7 +67,7 @@ endif() target_link_libraries(inja INTERFACE ${INJA_SELECTED_JSON_LIBRARY}) -execute_process(COMMAND python3 amalgamate/amalgamate.py -c amalgamate/config.json -s include WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) +execute_process(COMMAND scripts/update_single_include.sh WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) if (COVERALLS) diff --git a/amalgamate/config.json b/amalgamate/config.json index 8fce960..71cff85 100644 --- a/amalgamate/config.json +++ b/amalgamate/config.json @@ -2,7 +2,7 @@ "project": "inja", "target": "single_include/inja/inja.hpp", "sources": [ - "../include/inja/inja.hpp" + "inja/inja.hpp" ], "include_paths": [ ] diff --git a/meson.build b/meson.build index 666e2d8..810da17 100644 --- a/meson.build +++ b/meson.build @@ -10,6 +10,20 @@ inja_dep = declare_dependency( ) + +amalg_script = files('scripts/update_single_include.sh') + +amalg_files = files( + 'include/inja/inja.hpp', + 'include/inja/renderer.hpp', + 'include/inja/environment.hpp', + ) + +amalg_tgt = run_target( 'amalg', + command: amalg_script + ) + + inja_test = executable( 'inja_test', 'test/unit.cpp', @@ -18,6 +32,16 @@ inja_test = executable( dependencies: inja_dep ) +inja_single_test = executable( + 'inja_single_test', + 'test/unit.cpp', + 'test/unit-files.cpp', + 'test/unit-renderer.cpp', + 'single_include/inja/inja.hpp', + dependencies: [inja_dep] +) + + inja_benchmark = executable( 'inja_benchmark', 'test/benchmark.cpp', @@ -26,3 +50,4 @@ inja_benchmark = executable( test('Inja unit test', inja_test) +test('Inja single include test', inja_single_test) diff --git a/scripts/update_single_include.sh b/scripts/update_single_include.sh new file mode 100755 index 0000000..68a30ad --- /dev/null +++ b/scripts/update_single_include.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env sh + +if [ "${MESON_SOURCE_ROOT}" != "" ] +then + cd ${MESON_SOURCE_ROOT} +fi + +python3 amalgamate/amalgamate.py -c amalgamate/config.json -s include -v yes