[Meson] Apply work-around in order to fix gbs-build errors
[platform/adaptation/npu/trix-engine.git] / meson.build
1 # Do NOT enable C in core
2 # C++ is only allowed inside test directory for gtest.
3
4 project('npu-engine', 'c',
5   version: '0.0.1',
6   license: ['Proprietary'],
7   meson_version: '>=0.42.0',
8   default_options: [
9     'werror=true',
10     'warning_level=1',
11     'c_std=gnu89',
12   ]
13 )
14
15 add_project_arguments('-DVERSION="' + meson.project_version() + '"', language: ['c'])
16
17 cc = meson.get_compiler('c')
18
19 warning_c_flags = [
20   '-Wmissing-declarations',
21   '-Wmissing-prototypes',
22   '-Wnested-externs',
23   '-Waggregate-return',
24   '-Wold-style-definition',
25   '-Wdeclaration-after-statement'
26 ]
27
28 foreach extra_arg : warning_c_flags
29   if cc.has_argument (extra_arg)
30     add_project_arguments([extra_arg], language: 'c')
31   endif
32 endforeach
33
34 # Install Paths
35 ne_prefix = get_option('prefix')
36 ne_libdir = join_paths(ne_prefix, get_option('libdir'))
37 ne_bindir = join_paths(ne_prefix, get_option('bindir'))
38 ne_inidir = get_option('sysconfdir')
39 ne_common_inc = include_directories('../common/include')
40 ne_common_dep = declare_dependency(
41   include_directories: ne_common_inc
42 )
43
44 libdl_dep = cc.find_library('dl') # DL library
45 libm_dep = cc.find_library('m') # math library
46 libdrm_dep = dependency('libdrm') # libdrm library
47 thread_dep = dependency('threads') # pthread library
48 iniparser_dep = dependency('iniparser') # iniparser library
49
50 subdir('host')
51 subdir('core')
52
53 comm_opt = get_option('comm_opt')
54
55 if comm_opt == 'ip'
56   ne_dependencies = [
57     ne_common_dep,
58     plugin_ip_src_dep
59   ]
60
61   # Build final exported so
62   plugin_ip_executable = shared_library('npu-engine',
63     dependencies: ne_dependencies,
64     install : false)
65 endif