meson: simplify pybind dependency handling
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Fri, 6 Aug 2021 10:06:14 +0000 (13:06 +0300)
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Fri, 6 Aug 2021 10:09:13 +0000 (13:09 +0300)
py/pykms/meson.build

index b29cd9f..e030ce8 100644 (file)
@@ -4,13 +4,11 @@ if py3_dep.found() == false
     subdir_done()
 endif
 
-if get_option('system-pybind11').enabled()
-    pybind11_dep = dependency('pybind11')
-elif get_option('system-pybind11').disabled()
-    pybind11_proj = subproject('pybind11')
-    pybind11_dep = pybind11_proj.get_variable('pybind11_dep')
-else
-    pybind11_dep = dependency('pybind11', fallback : ['pybind11', 'pybind11_dep'])
+pybind11_dep = dependency('pybind11', fallback : ['pybind11', 'pybind11_dep'],
+                          required : get_option('pykms'))
+
+if pybind11_dep.found() == false
+    subdir_done()
 endif
 
 pykms_sources = files([