aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2022-07-28 09:35:14 +0300
committeraqua <aqua@iserlohn-fortress.net>2022-08-12 10:13:59 +0300
commit57cee4649c3950675a50b56c5ab1b62fbb022e5f (patch)
tree1eb8deef45af35dce5dbc24fa63bcf7fbcdfa60b /meson.build
parentPrint version, compiler id and version, and cpuid on boot (diff)
downloadkernel-57cee4649c3950675a50b56c5ab1b62fbb022e5f.tar.xz
Enable coverage report
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build19
1 files changed, 12 insertions, 7 deletions
diff --git a/meson.build b/meson.build
index 9896e66..2966733 100644
--- a/meson.build
+++ b/meson.build
@@ -1,6 +1,11 @@
-project('glitch kernel', 'c', version: '0.0.0', default_options: ['c_std=gnu11', 'warning_level=2'])
-python3 = import('python').find_installation('python3')
+project('glitch kernel', 'c', version: '0.0.0', default_options: ['c_std=gnu11', 'warning_level=2', 'b_coverage=true'])
+
cc = meson.get_compiler('c')
+if(cc.has_argument('-fanalyzer'))
+ add_project_arguments('-fanalyzer', language: 'c')
+endif
+python3 = import('python').find_installation('python3')
+qemu = find_program('qemu-system-i386')
conf = configuration_data()
conf.set_quoted('VERSION', run_command(['git', 'describe', '--long'], capture: true, check: true).stdout().strip())
@@ -9,14 +14,15 @@ configure_file(output: 'conf.h', configuration: conf)
subdir('arch/i686')
subdir('devices')
+subdir('lib')
kernel = executable('glitch.elf',
['src/multiboot2.c', 'src/mmap.c', 'src/kernel.c',
- 'src/isr.c', 'src/mem/vmm.c',
- 'lib/string/itoa.c', 'lib/stdio/printf.c'],
+ 'src/isr.c', 'src/mem/vmm.c'],
+ link_with: [libk],
link_language: 'c',
- link_args: ['-ffreestanding', '-static', '-T', meson.current_source_dir()/'arch/i686/linker.ld'],
- install: true, native: false,
+ link_args: ['-static', '-T', meson.current_source_dir()/'arch/i686/linker.ld'],
+ install: true, native: false, override_options: ['b_coverage=false'],
include_directories: [
include_directories('grub/include', is_system: true),
include_directories('lib')
@@ -28,5 +34,4 @@ glitch_iso = custom_target('glitch.iso',
input: 'scripts/mkiso.py', output: 'glitch.iso', depends: [kernel],
command: [python3, '@INPUT@', kernel, '@SOURCE_ROOT@/grub/grub.cfg'])
-qemu = find_program('qemu-system-i386')
run_target('run', depends: glitch_iso, command: [qemu, '-cdrom', 'glitch.iso', '-accel', 'kvm'])