-
Notifications
You must be signed in to change notification settings - Fork 3
/
meson.build
72 lines (58 loc) · 1.68 KB
/
meson.build
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
#
# See LICENSE for more information about licensing
# Copyright 2023
#
# Author: Diego Arturo Avila Torres <dandida95@gmail.com>
# Luis G. Leon Vega <luis.leon@ieee.org>
#
project('cynq',['c','cpp'],version : '0.2.0',
default_options : ['warning_level=3',
'cpp_std=c++17',
'cpp_args=-Werror'])
add_global_arguments(
'-Wno-ignored-qualifiers',
language : 'cpp'
)
cc = meson.get_compiler('cpp')
#############################
## Dependencies definition ##
#############################
build_tests = get_option('build-tests')
# directories
projectinc = [include_directories('.', 'include')]
# cflags
cpp_args = []
c_args = []
# dependencies
project_deps = []
# Install pre-commit hooks
developer_mode = get_option('developer-mode')
profiling_mode = get_option('profiling-mode')
if developer_mode
pre_commit = find_program('pre-commit', required: true, native: true)
run_command(pre_commit, 'install', check: false)
run_command(pre_commit, 'install', '--hook-type', 'commit-msg', check: false)
endif
if profiling_mode
cpp_args += ['-DPROFILE_MODE']
endif
if not get_option('build-docs-only')
# Imports pkgconfig module
pkgconfig = import('pkgconfig')
subdir('third-party')
subdir('include/cynq')
subdir('src')
subdir('examples')
pkgconfig_install_dir = join_paths(get_option('libdir'), 'pkgconfig')
pkgconfig.generate(libcynq, requires: ['xrt'])
endif
if get_option('build-docs') or get_option('build-docs-only')
subdir('docs')
endif
# Testing suite
if build_tests
gtest_proj = subproject('gtest')
gtest_dep = gtest_proj.get_variable('gtest_dep')
gmock_dep = gtest_proj.get_variable('gmock_dep')
subdir('tests')
endif