File: meson.build

package info (click to toggle)
inja 3.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,620 kB
  • sloc: cpp: 30,997; python: 189; makefile: 16; sh: 3
file content (79 lines) | stat: -rw-r--r-- 1,704 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
project(
  'inja',
  'cpp',
  version: '3.5.0',
  default_options: ['cpp_std=c++17', 'warning_level=3'],
  meson_version: '>=0.56'
)

pkgc = import('pkgconfig')

inja_dep = declare_dependency(
  include_directories: include_directories('include', 'third_party/include')
)


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/json.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/throw.hpp',
  'include/inja/token.hpp',
  'include/inja/utils.hpp',
  subdir: 'inja'
)

pkgc.generate(
    version: meson.project_version(),
    name: 'inja',
    description: 'Template engine for modern C++',
    url: 'https://github.com/pantor/inja',
    requires: ['nlohmann_json'],
    dataonly: true,
)


run_command(
  find_program('scripts/update_single_include.sh'),
  check: true
)


if get_option('build_tests')
  test_flags = ['-D__TEST_DIR__=' + meson.project_source_root() / 'test']

  inja_test = executable(
    'inja_test',
    'test/test.cpp',
    dependencies: inja_dep,
    cpp_args: test_flags,
  )

  inja_single_test = executable(
    'inja_single_test',
    'test/test.cpp',
    'single_include/inja/inja.hpp',
    dependencies: [inja_dep],
    cpp_args: test_flags,
  )

  test('Inja unit test', inja_test)
  test('Inja single include test', inja_single_test)


  inja_benchmark = executable(
    'inja_benchmark',
    'test/benchmark.cpp',
    dependencies: inja_dep,
    cpp_args: test_flags,
  )
endif