improve meson build

This commit is contained in:
pantor
2023-01-28 13:15:58 +01:00
parent 44b23f2ce7
commit ea47bb14dc
4 changed files with 31 additions and 61 deletions

View File

@@ -1,14 +0,0 @@
---
BasedOnStyle: LLVM
IndentWidth: 2
ColumnLimit: 160
---
Language: Cpp
SpaceBeforeCpp11BracedList: true
PointerAlignment: Left
AllowShortFunctionsOnASingleLine: Empty
AllowShortBlocksOnASingleLine: Empty
SpaceBeforeCtorInitializerColon: false
...

42
.gitignore vendored
View File

@@ -1,46 +1,12 @@
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# Build Folders
build
buildc
dist
# Coveralls repo token
.coveralls.yml
.vscode
.vs
build
build-*
doc/html
doc/latex
examples
__pycache__
examples

View File

@@ -1,4 +1,10 @@
project('inja', 'cpp', default_options: ['cpp_std=c++17'])
project(
'inja',
'cpp',
version: '3.3.0',
default_options: ['cpp_std=c++17', 'warning_level=3'],
meson_version: '>=0.56'
)
inja_dep = declare_dependency(
@@ -6,18 +12,30 @@ inja_dep = declare_dependency(
)
amalg_script = files('scripts/update_single_include.sh')
amalg_files = files(
install_headers(
'include/inja/config.hpp',
'include/inja/environment.hpp',
'include/inja/exceptions.hpp',
'include/inja/function_storage.hpp',
'include/inja/inja.hpp',
'include/inja/renderer.hpp',
'include/inja/environment.hpp',
'include/inja/lexer.hpp',
'include/inja/node.hpp',
'include/inja/parser.hpp',
'include/inja/renderer.hpp',
'include/inja/statistics.hpp',
'include/inja/template.hpp',
'include/inja/token.hpp',
'include/inja/utils.hpp',
subdir: 'inja'
)
amalg_tgt = run_target( 'amalg',
command: amalg_script
run_command(
find_program('scripts/update_single_include.sh'),
check: true
)
if get_option('build_tests')
inja_test = executable(
'inja_test',

View File

@@ -265,7 +265,7 @@ TEST_CASE("callbacks") {
CHECK(env.render("{{ double-greetings() }}", data) == "Hello Hello!");
CHECK(env.render("{{ multiply(4, 5) }}", data) == "20.0");
CHECK(env.render("{{ multiply(4, 2 + 3) }}", data) == "20.0");
CHECK(env.render("{{ multiply(2 + 2, 5) }}", data) == "20.0");
CHECK(env.render("{{ multiply(2 + 2, 6) }}", data) == "24.0");
CHECK(env.render("{{ multiply(length(\"tester\"), 5) }}", data) == "30.0");
CHECK(env.render("{{ multiply(5, length(\"t\")) }}", data) == "5.0");
CHECK(env.render("{{ multiply(3, 4, 5) }}", data) == "60.0");