Skip to content

Commit

Permalink
check for optional module dependencies and don't build optional modul…
Browse files Browse the repository at this point in the history
…es if not found
  • Loading branch information
jason committed Jul 24, 2024
1 parent 2918a0b commit 6be63b2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 0 additions & 2 deletions lcm-lua/meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
lcm_lua_sources = ['init.c', 'lualcm_hash.c', 'lualcm_lcm.c', 'lualcm_pack.c', 'lua_ref_helper.c', 'utf8_check.c']

lua_dep = dependency('lua')

lcm_lua_lib = library('lcm-lua', lcm_lua_sources,
c_args : '-Wextra',
dependencies : [lcm_lib_dep, lua_dep],
Expand Down
1 change: 0 additions & 1 deletion lcm-python/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pymod = import('python')
py_installation = pymod.find_installation()
python_site = py_installation.get_path('platlib').replace(py_installation.get_path('data') / '', '')
python_include = py_installation.get_path('include')
Expand Down
10 changes: 8 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ endif

# Python
if not get_option('lcm_enable_python').disabled()
subdir('lcm-python')
pymod = import('python', required : get_option('lcm_enable_python'))
if pymod.found()
subdir('lcm-python')
endif
endif

# Java (Work in progress)
Expand All @@ -55,7 +58,10 @@ endif

# Lua
if not get_option('lcm_enable_lua').disabled()
subdir('lcm-lua')
lua_dep = dependency('lua', required : get_option('lcm_enable_lua'))
if lua_dep.found()
subdir('lcm-lua')
endif
endif

# Disabled because require pro meson wizardry to support without user-defined functions
Expand Down

0 comments on commit 6be63b2

Please sign in to comment.