meson: better handling of dependency using disabler
authorsubhransu mohanty <sub.mohanty@samsung.com>
Wed, 10 Jul 2019 04:22:25 +0000 (13:22 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Thu, 18 Jul 2019 11:04:28 +0000 (20:04 +0900)
example/meson.build

index 7505801..9df49ef 100644 (file)
@@ -18,45 +18,44 @@ executable('vectorTest',
            include_directories : inc,
            dependencies : [rlottie_lib_dep])
 
-demo_dep = dependency('elementary', required : false)
+demo_dep = dependency('elementary', required : false, disabler : true)
 
-if (demo_dep.found())
-    executable('demo',
-               demo_sources,
-               include_directories : inc,
-               override_options : override_default,
-               link_with : rlottie_lib,
-               dependencies : demo_dep)
+executable('demo',
+           demo_sources,
+           include_directories : inc,
+           override_options : override_default,
+           link_with : rlottie_lib,
+           dependencies : demo_dep)
 
-    lottieview_test_src  = files('lottieviewtest.cpp')
-    lottieview_test_src += common_source
+lottieview_test_src  = files('lottieviewtest.cpp')
+lottieview_test_src += common_source
 
-    executable('lottieviewTest',
-               lottieview_test_src,
-               include_directories : inc,
-               override_options : override_default,
-               link_with : rlottie_lib,
-               dependencies : demo_dep)
+executable('lottieviewTest',
+           lottieview_test_src,
+           include_directories : inc,
+           override_options : override_default,
+           link_with : rlottie_lib,
+           dependencies : demo_dep)
 
-    uxsample_test_src  = files('uxsampletest.cpp')
-    uxsample_test_src += common_source
+uxsample_test_src  = files('uxsampletest.cpp')
+uxsample_test_src += common_source
 
-    executable('uxsampleTest',
-               uxsample_test_src,
-               include_directories : inc,
-               override_options : override_default,
-               link_with : rlottie_lib,
-               dependencies : demo_dep)
+executable('uxsampleTest',
+           uxsample_test_src,
+           include_directories : inc,
+           override_options : override_default,
+           link_with : rlottie_lib,
+           dependencies : demo_dep)
 
-    lottieviewer_sources = files('lottieviewer.cpp')
-    lottieviewer_sources += common_source
+lottieviewer_sources = files('lottieviewer.cpp')
+lottieviewer_sources += common_source
 
-    executable('lottieviewer',
-               lottieviewer_sources,
-               include_directories : inc,
-               override_options : override_default,
-               link_with : rlottie_lib,
-               dependencies : demo_dep)
+executable('lottieviewer',
+           lottieviewer_sources,
+           include_directories : inc,
+           override_options : override_default,
+           link_with : rlottie_lib,
+           dependencies : demo_dep)
 
 if (meson.get_compiler('cpp').has_header('elementary-1/efl_ui_animation_view.h'))
     executable('efl_animview',
@@ -67,4 +66,3 @@ if (meson.get_compiler('cpp').has_header('elementary-1/efl_ui_animation_view.h')
                dependencies : demo_dep)
 endif
 
-endif