Skip to content

Commit

Permalink
meson: add system-pybind11 option
Browse files Browse the repository at this point in the history
Add system-pybind11 option (dependency only required if pykms is enabled).

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Changes v2 -> v3:
  - build pykms only if pybind11 dependency is found
Changes v1 -> v2:
  - renamed use-system-pybind11 to system-pybind11 option
  - change system-pybind11 dependency only required if pykms is enabled
  • Loading branch information
pseiderer committed Dec 1, 2020
1 parent 706b800 commit 6a507ae
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
8 changes: 6 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ else
compile_args : '-DFMT_HEADER_ONLY')
endif

pybind11_includes = include_directories('ext/pybind11/include')
pybind11_dep = declare_dependency(include_directories : pybind11_includes)
if get_option('system-pybind11')
pybind11_dep = dependency('pybind11', required : get_option('pykms'))
else
pybind11_includes = include_directories('ext/pybind11/include')
pybind11_dep = declare_dependency(include_directories : pybind11_includes)
endif

libdrmomap_dep = dependency('libdrm_omap', required : get_option('omap'))

Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ option('omap', type : 'feature', value : 'auto')
option('static-libc', type : 'boolean', value : false)
option('utils', type : 'boolean', value : true)
option('system-fmt', type : 'boolean', value : false)
option('system-pybind11', type : 'boolean', value : false)
4 changes: 4 additions & 0 deletions py/pykms/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ if py3_dep.found() == false
subdir_done()
endif

if pybind11_dep.found() == false
subdir_done()
endif

pykms_sources = files([
'pykmsbase.cpp',
'pykms.cpp',
Expand Down

0 comments on commit 6a507ae

Please sign in to comment.