[Action] upload meson test log if test failed
[platform/adaptation/npu/trix-engine.git] / meson.build
index 9b4a96f..f1c17f5 100644 (file)
@@ -1,6 +1,6 @@
 project('npu-engine', ['c', 'cpp'],
-  version: '2.3.5',
-  license: ['Proprietary'],
+  version: '2.5.0',
+  license: ['Apache-2.0'],
   meson_version: '>=0.47.0',
   default_options: [
     'werror=true',
@@ -16,12 +16,6 @@ sysroot = run_command(
     cpp.cmd_array() + ['-print-sysroot']
     ).stdout().split('\n')[0]
 
-build_platform = ''
-if get_option('enable_tizen')
-  add_project_arguments('-D__TIZEN__=1', language: ['c', 'cpp'])
-  build_platform = 'tizen'
-endif
-
 warning_c_flags = [
   '-Wmissing-prototypes',
   '-Wmissing-declarations',
@@ -43,6 +37,7 @@ warning_flags = [
   '-Wvla',
   '-Wpointer-arith',
   '-Wno-sign-compare',
+  '-Wno-packed-not-aligned'
 ]
 
 foreach extra_arg : warning_c_flags
@@ -80,21 +75,34 @@ add_project_arguments('-DNE_DATADIR="' + ne_datadir + '"', language: ['c', 'cpp'
 
 ne_common_inc = include_directories('include/common')
 ne_host_inc = include_directories('include/host')
+ne_uapi_inc = include_directories('include/uapi')
 
-if not get_option('enable_npu_emul')
+# Check build platform
+target_platform = get_option('target_platform')
+if target_platform == 'tizen'
+  add_project_arguments('-D__TIZEN__=1', language: ['c', 'cpp'])
+elif target_platform == 'fpga'
   ne_kernel_hdr = get_option('kernel_hdr_dir')
   ne_hernel_hdr_cflags = '-I' + ne_kernel_hdr
   if cpp.has_header('misc/trinity.h', args: ne_hernel_hdr_cflags)
     add_project_arguments(ne_hernel_hdr_cflags, language: ['c', 'cpp'])
+    add_project_arguments('-D__FPGA__=1', language: ['c', 'cpp'])
   else
     if not cpp.has_header('misc/trinity.h')
       error('Failed to find \'misc/trintiy.h\'. Try to use the -Dkernel_hdr_dir option.')
     endif
   endif
+else
+  # Default: debian distro
+  add_project_arguments('-I' + ne_prefix + '/include', language: ['c', 'cpp'])
+endif
+
+if get_option('enable_npu_emul')
+  add_project_arguments('-DENABLE_EMUL', language: ['c', 'cpp'])
 endif
 
-if get_option('enable_fpga_workaround')
-  add_project_arguments('-DENABLE_FPGA_WORKAROUND', language: ['c', 'cpp'])
+if get_option('enable_npu_cuse')
+  add_project_arguments('-DENABLE_CUSE', language: ['c', 'cpp'])
 endif
 
 if sysroot.startswith('/')
@@ -126,10 +134,6 @@ if not iniparser_dep.found()
 endif
 libdrm_dep = dependency('libdrm')
 
-if get_option('enable_npu_emul')
-  add_project_arguments('-I' + ne_prefix + '/include', language: ['c', 'cpp'])
-  add_project_arguments('-DENABLE_EMUL', language: ['c', 'cpp'])
-endif
 if get_option('enable_data_manip')
   add_project_arguments('-DENABLE_MANIP', language: ['c', 'cpp'])
 endif
@@ -138,8 +142,9 @@ if get_option('enable_buffering')
 endif
 
 subdir('src')
-subdir('tests')
 subdir('utils')
+subdir('plugins')
+subdir('tests')
 
 # Set configuration to install .ini
 ne_install_conf = configuration_data()
@@ -152,8 +157,11 @@ ne_install_conf.set('INCLUDE_INSTALL_DIR', ne_includedir)
 
 ne_install_conf.set('RESV_MEM_SIZE', get_option('resv_mem_size'))
 ne_install_conf.set('NUM_THREADS', get_option('num_threads'))
+ne_install_conf.set('PREFIX_SHARE', ne_prefix + get_option('prefix_share'))
+ne_install_conf.set('PREFIX_PROFILE', get_option('prefix_profile'))
 ne_install_conf.set('LOG_DIR', get_option('log_dir'))
 ne_install_conf.set('LOG_LEVEL', get_option('log_level'))
+ne_install_conf.set('MUTE_STDOUT', get_option('mute_stdout'))
 
 # Install .ini
 configure_file(input: 'npu-engine.ini.in', output: 'npu-engine.ini',