~satchmo/libvmm

ref: d1e2394c16ab1264d23a2c78607433815c3fbb23 libvmm/meson.build -rw-r--r-- 1.6 KiB
d1e2394cJason Phan memory: Move includes in addres.hpp out of namespace 8 months ago
                                                                                
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
# General
project(
  'libvmm',
  'cpp',
  version : '0.1.0',
  license : 'MIT',
  default_options : [
  'cpp_std=c++17',
  'warning_level=3',
  'werror=true',
  ],
)

warnings = [
  '-Wcast-align', # if there are potential performance problem casts
  '-Wconversion', # if there are type conversions that may lose data
  '-Wno-missing-field-initializers', # disable missing-field-initializers warnings
  '-Wsign-conversion', # sign conversions
  '-Wshadow', # if a variable declaration shadows one from a parent context
  '-Wunused', # If anything is unused
]

cc = meson.get_compiler('cpp')

add_project_arguments(
    cc.get_supported_arguments(warnings),
    language: 'cpp',
)

add_project_link_arguments(
  '-lstdc++fs',
  language: 'cpp',
)

# Target
sources = []

subdir('vmm')

target = shared_library(
  'vmm',
  sources,
  install: true,
  include_directories : public_headers,
)

# Project
project_description = 'Modular VMM and hypervisor components'
pkgc = import('pkgconfig')

pkgc.generate(
  name : meson.project_name(),
  version : meson.project_version(),
  description : project_description,
  subdirs : meson.project_name(),
  libraries : target,
)

project_dep = declare_dependency(
  include_directories: public_headers,
  link_with : target
)

# Unit Tests
if not meson.is_subproject()
  test_suites = {}

  subdir('tests')

  foreach n_suite, s : test_suites
    foreach n_test, f : s
        test(n_test, executable(n_test,
                                f,
                                dependencies : [project_dep, test_dep],
                                install : false))
    endforeach
  endforeach
endif