Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/meson support #522

Open
wants to merge 74 commits into
base: master
Choose a base branch
from
Open

Conversation

Zinput
Copy link

@Zinput Zinput commented Jul 23, 2024

Add support for building LCM with Meson and add workflow tests for LCM built with Meson. Supports LCM core features. Meson support will make it easier to use LCM as a subproject in other Meson projects.

Does not support building Python, Java, and Lua modules from Meson for now (moved to new branch to simplify pull request).

lcm-pkgconfig/meson.build Show resolved Hide resolved
docs/meson.build Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
examples/c/meson.build Outdated Show resolved Hide resolved
meson.build Outdated Show resolved Hide resolved
lcm-java/jchart2d-code/meson.build Outdated Show resolved Hide resolved
meson.build Show resolved Hide resolved
liblcm-test/meson.build Outdated Show resolved Hide resolved
lcm/meson.build Outdated Show resolved Hide resolved
Comment on lines 8 to 44
if windows
lcm_python_lib = library('lcm-python', lcm_python_sources,
dependencies : lcm_static_lib_dep,
include_directories : include_directories(python_include),
install_dir : python_site + '/lcm',
name_suffix : '.pyd')
elif host_machine.system() == 'darwin' #macos
lcm_python_lib = library('lcm-python', lcm_python_sources,
dependencies : lcm_static_lib_dep,
include_directories : include_directories(python_include),
install_dir : python_site + '/lcm',
link_args : '-undefined dynamic_lookup -Wl,-no_fixup_chains')
else
lcm_python_lib = library('lcm-python', lcm_python_sources,
dependencies : lcm_static_lib_dep,
include_directories : include_directories(python_include),
install_dir : python_site + '/lcm')
endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll want a Python extension module rather than library here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched to extension_module and set up install: 7ebd789

Copy link
Contributor

@nosracd nosracd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add a section to the build instructions documenting how to build LCM using meson?

lcm-python/meson.build Outdated Show resolved Hide resolved
meson.build Outdated Show resolved Hide resolved
lcm/meson.build Outdated Show resolved Hide resolved
@Zinput Zinput force-pushed the feature/meson_support branch 3 times, most recently from 5a2e0f9 to 5be306d Compare July 26, 2024 15:03
@Zinput
Copy link
Author

Zinput commented Jul 26, 2024

Could you also add a section to the build instructions documenting how to build LCM using meson?

Done: 5be306d

Copy link
Contributor

@nosracd nosracd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is starting to look pretty good. Thanks for your work on this!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way the Cmake support does this is it creates a python/lcm/ directory in the build directory which contains both the library and __init__.py. As it currently is, a user would have to import _lcm which isn't in line with the docs.

You might be able to recreate something similar here by removing these extension_module calls to an lcm subdir. Then you might be able to copy in the __init__.py by using a meson function like configure_file, although you might have to resort to one of the newer features like the filesystem module.

lcm-java/meson.build Outdated Show resolved Hide resolved
jason added 25 commits August 9, 2024 13:54
fix python library installation and remove comment
…ring back hacky platlib dir for compatibility with ubuntu 22.04's ancient meson version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants