Meson: setup configure values before executing subdir
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 15 Jan 2020 05:36:52 +0000 (14:36 +0900)
committerwooksong <wook16.song@samsung.com>
Mon, 20 Jan 2020 06:24:37 +0000 (22:24 -0800)
We now have a subdir that requires to read the configuration values.
Thus, configure values before calling subdirs.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
meson.build

index dcfbb6e..f3f8a7c 100644 (file)
@@ -244,6 +244,38 @@ if get_option('enable-tflite-nnapi-delegation')
   # For tf-lite/nnapi, enable-nnfw allows to use nnfw::tflite::nnapi as a backend.
 endif
 
+# Set configuration to install .ini
+nnstreamer_install_conf = configuration_data()
+nnstreamer_install_conf.merge_from(nnstreamer_conf)
+
+nnstreamer_install_conf.set('ENABLE_ENV_VAR', get_option('enable-env-var'))
+nnstreamer_install_conf.set('ENABLE_SYMBOLIC_LINK', get_option('enable-symbolic-link'))
+nnstreamer_install_conf.set('TORCH_USE_GPU', get_option('enable-pytorch-use-gpu'))
+nnstreamer_install_conf.set('NNFW_RUNTIME_PRIORITIZE', get_option('nnfw-runtime-prioritize'))
+
+# Element restriction
+restriction_config = ''
+
+if get_option('enable-element-restriction')
+  restriction_config = '''[element-restriction]
+enable_element_restriction=True
+restricted_elements=''' + get_option('restricted-elements')
+endif
+
+nnstreamer_install_conf.set('ELEMENT_RESTRICTION_CONFIG', restriction_config)
+
+# Install .ini
+configure_file(input: 'nnstreamer.ini.in', output: 'nnstreamer.ini',
+  install_dir: nnstreamer_inidir,
+  configuration: nnstreamer_install_conf
+)
+
+# Install .pc
+configure_file(input: 'nnstreamer.pc.in', output: 'nnstreamer.pc',
+  install_dir: join_paths(nnstreamer_libdir, 'pkgconfig'),
+  configuration: nnstreamer_install_conf
+)
+
 # Build nnstreamer (common, plugins)
 subdir('gst')
 
@@ -278,35 +310,3 @@ if get_option('enable-test')
     configuration: nnstreamer_test_conf
   )
 endif
-
-# Set configuration to install .ini
-nnstreamer_install_conf = configuration_data()
-nnstreamer_install_conf.merge_from(nnstreamer_conf)
-
-nnstreamer_install_conf.set('ENABLE_ENV_VAR', get_option('enable-env-var'))
-nnstreamer_install_conf.set('ENABLE_SYMBOLIC_LINK', get_option('enable-symbolic-link'))
-nnstreamer_install_conf.set('TORCH_USE_GPU', get_option('enable-pytorch-use-gpu'))
-nnstreamer_install_conf.set('NNFW_RUNTIME_PRIORITIZE', get_option('nnfw-runtime-prioritize'))
-
-# Element restriction
-restriction_config = ''
-
-if get_option('enable-element-restriction')
-  restriction_config = '''[element-restriction]
-enable_element_restriction=True
-restricted_elements=''' + get_option('restricted-elements')
-endif
-
-nnstreamer_install_conf.set('ELEMENT_RESTRICTION_CONFIG', restriction_config)
-
-# Install .ini
-configure_file(input: 'nnstreamer.ini.in', output: 'nnstreamer.ini',
-  install_dir: nnstreamer_inidir,
-  configuration: nnstreamer_install_conf
-)
-
-# Install .pc
-configure_file(input: 'nnstreamer.pc.in', output: 'nnstreamer.pc',
-  install_dir: join_paths(nnstreamer_libdir, 'pkgconfig'),
-  configuration: nnstreamer_install_conf
-)