mirror of
https://github.com/pantor/inja.git
synced 2026-02-17 09:03:58 +00:00
Add meson target to update single include (#86)
- You can now update the single include file in a meson build by using the target 'amalg'. - The meson build also now builds the single include test suite. - cmake build updated to use the new script to update the single include.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"project": "inja",
|
||||
"target": "single_include/inja/inja.hpp",
|
||||
"sources": [
|
||||
"../include/inja/inja.hpp"
|
||||
"inja/inja.hpp"
|
||||
],
|
||||
"include_paths": [
|
||||
]
|
||||
|
||||
25
meson.build
25
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)
|
||||
|
||||
8
scripts/update_single_include.sh
Executable file
8
scripts/update_single_include.sh
Executable file
@@ -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
|
||||
Reference in New Issue
Block a user