This patchs cleans code in meson build scripts.
Signed-off-by: Wook Song <wook16.song@samsung.com>
# Do NOT enable C in core
# C++ is only allowed inside test directory for gtest.
# Do NOT enable C in core
# C++ is only allowed inside test directory for gtest.
-project('npu-engine', 'c',
+project('npu-engine', ['c', 'cpp'],
version: '0.0.3',
license: ['Proprietary'],
meson_version: '>=0.42.0',
version: '0.0.3',
license: ['Proprietary'],
meson_version: '>=0.42.0',
'werror=true',
'warning_level=1',
'c_std=gnu89',
'werror=true',
'warning_level=1',
'c_std=gnu89',
-add_project_arguments('-DVERSION="' + meson.project_version() + '"',
- language: ['c'])
-
cc = meson.get_compiler('c')
cc = meson.get_compiler('c')
+cpp = meson.get_compiler('cpp')
warning_c_flags = [
'-Wmissing-declarations',
warning_c_flags = [
'-Wmissing-declarations',
foreach extra_arg : warning_c_flags
if cc.has_argument (extra_arg)
foreach extra_arg : warning_c_flags
if cc.has_argument (extra_arg)
- add_project_arguments([extra_arg], language: 'c')
+ add_project_arguments([extra_arg], language : 'c')
+ elif cpp.has_argument (extra_arg)
+ add_project_arguments([extra_arg], language : 'cpp')
iniparser_dep = dependency('iniparser') # iniparser library
if get_option('enable_npu_emul')
iniparser_dep = dependency('iniparser') # iniparser library
if get_option('enable_npu_emul')
- npuvision_dep = dependency('libnpuvision') # npuvision library
-
- add_project_arguments('-I/opt/trinity/include', language: 'c')
- add_project_arguments('-I/opt/trinity/include', language: 'cpp')
- add_project_arguments('-DENABLE_EMUL', language: 'c')
- add_project_arguments('-DENABLE_EMUL', language: 'cpp')
+ add_project_arguments('-I/opt/trinity/include', language: ['c', 'cpp'])
+ add_project_arguments('-DENABLE_EMUL', language: ['c', 'cpp'])
ne_core_npu_inc = include_directories('.')
ne_core_npu_inc = include_directories('.')
-if get_option('enable_npu_emul') and npuvision_dep.found()
- add_languages('cpp')
- add_project_arguments('-std=c++11', language: 'cpp')
-
+if get_option('enable_npu_emul')
ne_core_npu_dep = declare_dependency(
sources : ['NPUdrvAPI.c', 'NPUemul.cpp'],
ne_core_npu_dep = declare_dependency(
sources : ['NPUdrvAPI.c', 'NPUemul.cpp'],
- dependencies : [ne_core_utils_dep, ne_core_gem_dep, npuvision_dep],
+ dependencies : [ne_core_utils_dep, ne_core_gem_dep, dependency('libnpuvision')],
include_directories : [ne_common_inc, ne_core_npu_inc])
else
ne_core_npu_dep = declare_dependency(
include_directories : [ne_common_inc, ne_core_npu_inc])
else
ne_core_npu_dep = declare_dependency(