Skip to content

Commit

Permalink
add detailed summary
Browse files Browse the repository at this point in the history
  • Loading branch information
jason committed Jul 26, 2024
1 parent 5d8ff8e commit 02af9ca
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 64 deletions.
43 changes: 36 additions & 7 deletions lcm-java/meson.build
Original file line number Diff line number Diff line change
@@ -1,11 +1,40 @@
lcm_java_sources = ['lcm/util/JImage.java', 'lcm/util/TableSorter.java', 'lcm/util/BufferedRandomAccessFile.java', 'lcm/util/ParameterListener.java', 'lcm/util/ParameterGUI.java', 'lcm/util/ClassDiscoverer.java', 'lcm/util/ColorMapper.java', 'lcm/spy/Spy.java', 'lcm/spy/ObjectPanel.java', 'lcm/spy/ChartData.java', 'lcm/spy/ChannelData.java', 'lcm/spy/ZoomableChartScrollWheel.java', 'lcm/spy/SpyPlugin.java', 'lcm/spy/LCMTypeDatabase.java', 'lcm/logging/LogDiagnostic.java', 'lcm/logging/JScrubber.java', 'lcm/logging/JScrubberListener.java', 'lcm/logging/Log.java', 'lcm/logging/LogPlayer.java', 'lcm/lcm/LCMDataOutputStream.java', 'lcm/lcm/Provider.java', 'lcm/lcm/LCMDataInputStream.java', 'lcm/lcm/UDPMulticastProvider.java', 'lcm/lcm/LCMSubscriber.java', 'lcm/lcm/URLParser.java', 'lcm/lcm/MessageAggregator.java', 'lcm/lcm/MemqProvider.java', 'lcm/lcm/LCMEncodable.java', 'lcm/lcm/LCM.java', 'lcm/lcm/LogFileProvider.java', 'lcm/lcm/TCPProvider.java', 'lcm/lcm/TCPService.java']
lcm_java_doc_classes = ['lcm/lcm/LCM.java', 'lcm/lcm/LCMEncodable.java', 'lcm/lcm/LCMSubscriber.java', 'lcm/lcm/MessageAggregator.java', 'lcm/logging/Log.java']

jar('lcm-java',
lcm_java_sources,
install_dir : 'share/java')
proceed_build = 'yes'
error_messages = ['Java is not currently supported! Try at your own risk.']

lcm_java_doc_classes = ['lcm/lcm/LCM.java', 'lcm/lcm/LCMEncodable.java', 'lcm/lcm/LCMSubscriber.java', 'lcm/lcm/MessageAggregator.java', 'lcm/logging/Log.java']
if get_option('lcm_enable_java').disabled()
proceed_build = disabler()
error_messages += ['Meson configured with -Dlcm_enable_java=disabled']
elif not add_languages('java', required : get_option('lcm_enable_java').enabled())
proceed_build = disabler()
error_messages += ['Missing dependency java']
else
jchart2d_dep = dependency('jchart2d', required : get_option('lcm_enable_java').enabled())
if not jchart2d_dep.found()
proceed_build = disabler()
error_messages += ['Missing dependency jchart2d']
endif
endif

if not is_disabler(proceed_build)
jar('lcm-java',
lcm_java_sources,
install_dir : 'share/java')
jar('doc-java',
lcm_java_doc_classes,
install_dir : 'docs/_build/javadocs')
endif

summary(
{'Build Java bindings and utilities' : not is_disabler(proceed_build)},
section : 'Options',
bool_yn : true)
if error_messages.length() > 0
summary({'- Build Java bindings and utilities error(s)': error_messages},
section: 'Options')
endif

jar('doc-java',
lcm_java_doc_classes,
install_dir : 'docs/_build/javadocs')
unset_variable('error_messages')
unset_variable('proceed_build')
35 changes: 31 additions & 4 deletions lcm-lua/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
lcm_lua_sources = ['init.c', 'lualcm_hash.c', 'lualcm_lcm.c', 'lualcm_pack.c', 'lua_ref_helper.c', 'utf8_check.c']

lcm_lua_lib = library('lcm-lua', lcm_lua_sources,
c_args : '-Wextra',
dependencies : [lcm_lib_dep, lua_dep],
install : true)
proceed_build = 'yes'
error_messages = []

if get_option('lcm_enable_lua').disabled()
proceed_build = disabler()
error_messages += ['Meson configured with -Dlcm_enable_lua=disabled']
else
lua_dep = dependency('lua', required : get_option('lcm_enable_lua').enabled())
if not lua_dep.found()
proceed_build = disabler()
error_messages += ['Missing dependency lua']
endif
endif

if not is_disabler(proceed_build)
lcm_lua_lib = library('lcm-lua', lcm_lua_sources,
c_args : '-Wextra',
dependencies : [lcm_lib_dep, lua_dep],
install : true)
endif

summary({'Build Lua bindings and utilities': not is_disabler(proceed_build)},
section: 'Options',
bool_yn: true)
if error_messages.length() > 0
summary({'- Build Lua bindings and utilities error(s)': error_messages},
section: 'Options')
endif

unset_variable('error_messages')
unset_variable('proceed_build')
72 changes: 49 additions & 23 deletions lcm-python/meson.build
Original file line number Diff line number Diff line change
@@ -1,28 +1,54 @@
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')

lcm_python_sources = ['module.c', 'pyeventlog.c', 'pylcm.c', 'pylcm_subscription.c']

if windows
# lcm_python_lib = py_installation.extension_module('lcm', lcm_python_sources,
# dependencies : lcm_static_lib_dep,
# include_directories : include_directories(python_include),
# install : true)
message('Python not currently supported in this LCM build for Windows')
elif host_machine.system() == 'darwin' #macos
lcm_python_lib = py_installation.extension_module('lcm', lcm_python_sources,
dependencies : lcm_static_lib_dep,
include_directories : include_directories(python_include),
link_args : '-undefined dynamic_lookup -Wl,-no_fixup_chains',
install : true)
proceed_build = 'yes'
error_messages = []

if get_option('lcm_enable_python').disabled()
proceed_build = disabler()
error_messages += ['Meson configured with -Dlcm_enable_python=disabled']
else
lcm_python_lib = py_installation.extension_module('lcm', lcm_python_sources,
dependencies : lcm_static_lib_dep,
include_directories : include_directories(python_include),
install_dir : python_site + '/lcm',
install : true)
pymod = import('python', required : get_option('lcm_enable_lua').enabled())
if not pymod.found()
proceed_build = disabler()
error_messages += ['Missing dependency python']
endif
endif

if not is_disabler(proceed_build)
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')
if windows
# lcm_python_lib = py_installation.extension_module('lcm', lcm_python_sources,
# dependencies : lcm_static_lib_dep,
# include_directories : include_directories(python_include),
# install : true)
error_messages += ['Python not currently supported in this LCM build for Windows! Not building.']
elif host_machine.system() == 'darwin' #macos
lcm_python_lib = py_installation.extension_module('lcm', lcm_python_sources,
dependencies : lcm_static_lib_dep,
include_directories : include_directories(python_include),
link_args : '-undefined dynamic_lookup -Wl,-no_fixup_chains',
install : true)
else
lcm_python_lib = py_installation.extension_module('lcm', lcm_python_sources,
dependencies : lcm_static_lib_dep,
include_directories : include_directories(python_include),
install_dir : python_site + '/lcm',
install : true)
endif

install_data('lcm/__init__.py', install_dir :'python/lcm')
install_data('lcm/__init__.py', install_dir :python_site + '/lcm')
endif

summary({'Build Python bindings and utilities': not is_disabler(proceed_build)},
section: 'Options',
bool_yn: true)
if error_messages.length() > 0
summary({'- Build Python bindings and utilities error(s)': error_messages},
section: 'Options')
endif

install_data('lcm/__init__.py', install_dir :'python/lcm')
install_data('lcm/__init__.py', install_dir :python_site + '/lcm')
unset_variable('error_messages')
unset_variable('proceed_build')
55 changes: 26 additions & 29 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if windows
ws2_32 = cpp.find_library('ws2_32')
endif

# Core modules
### Core modules ###
# lcm-gen compiles with warnings that cannot be disabled when lcm is used
# as a Meson subproject in a parent project with more warnings enabled. Allow
# parent projects to disable compilation of lcm-gen to fix warnings as needed.
Expand All @@ -40,29 +40,15 @@ if not get_option('lcm_enable_examples').disabled()
subdir('liblcm-test')
endif

### Extra modules ###
# Python (Work in progress)
# Currently doesn't compile for Windows
if not get_option('lcm_enable_python').disabled()
pymod = import('python', required : get_option('lcm_enable_python'))
if pymod.found()
subdir('lcm-python')
endif
endif

subdir('lcm-python')
# Java (Work in progress)
# Not working and need jchart2d dependencies or subproject build
# if not get_option('lcm_enable_java').disabled()
# add_languages('java')
# subdir('lcm-java')
# endif

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

# Disabled because require pro meson wizardry to support without user-defined functions
# Unit tests
Expand All @@ -80,13 +66,24 @@ if not get_option('lcm_install_pkgconfig').disabled()
subdir('lcm-pkgconfig')
endif

summary({'Build test and example programs': get_option('lcm_enable_examples'),
'Build Python bindings and utilities': get_option('lcm_enable_python'),
'Build Java bindings and utilities': get_option('lcm_enable_java'),
'Build Lua bindings and utilities': get_option('lcm_enable_lua'),
'Build unit tests': get_option('lcm_enable_tests'),
'Install autotools support M4 macros': get_option('lcm_install_m4macros'),
'Install pkg-config files': get_option('lcm_install_pkgconfig'),
'Build shared libraries': get_option('build_shared_libs'),
'Build lcmgen core modules': get_option('lcm_enable_lcmgen'),
}, section : 'Options')
enabled_options = {'Build test and example programs': get_option('lcm_enable_examples'),
'Build unit tests': get_option('lcm_enable_tests'),
'Install autotools support M4 macros': get_option('lcm_install_m4macros'),
'Install pkg-config files': get_option('lcm_install_pkgconfig'),
'Build shared libraries': get_option('build_shared_libs'),
'Build lcmgen core modules': get_option('lcm_enable_lcmgen')}

summary_reference = {}

foreach option, state: enabled_options
if option == 'Build unit tests'
summary_reference += {option: false}
summary_reference += {'- Build unit tests errors(s)': 'Unit tests are currently unsupported!'}
else
summary_reference += {option: not state.disabled()}
endif
endforeach

summary(summary_reference,
section : 'Options',
bool_yn : true)
2 changes: 1 addition & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ option('lcm_enable_examples', type : 'feature', value : 'enabled', description :
option('lcm_enable_python', type : 'feature', value : 'auto', description : 'Build Python bindings and utilities')
option('lcm_enable_java', type : 'feature', value : 'auto', description : 'Build Java bindings and utilities')
option('lcm_enable_lua', type : 'feature', value : 'auto', description : 'Build Lua bindings and utilities')
option('lcm_enable_tests', type : 'feature', value : 'enabled', description : 'Build unit tests')
option('lcm_enable_tests', type : 'feature', value : 'disabled', description : 'Build unit tests')
option('lcm_install_m4macros', type : 'feature', value : 'enabled', description : 'Install autotools support M4 macros')
option('lcm_install_pkgconfig', type : 'feature', value : 'enabled', description : 'Install pkg-config files')
option('build_shared_libs', type : 'feature', value: 'enabled', description : 'Build shared libraries')
Expand Down

0 comments on commit 02af9ca

Please sign in to comment.