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

Merged
merged 78 commits into from
Dec 23, 2024
Merged

Feature/meson support #522

merged 78 commits into from
Dec 23, 2024

Conversation

Zinput
Copy link
Contributor

@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 12
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
Contributor 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

@Zinput Zinput force-pushed the feature/meson_support branch from c09c279 to 2918a0b Compare July 24, 2024 19:55
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
Contributor 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
@Zinput Zinput force-pushed the feature/meson_support branch from 531fabc to daedc52 Compare August 9, 2024 18:56
@Zinput Zinput force-pushed the feature/meson_support branch from fc13eb2 to 946bf68 Compare November 14, 2024 20:29
@Zinput Zinput force-pushed the feature/meson_support branch from 946bf68 to f5adeb5 Compare November 14, 2024 20:48
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.

Looks good to me. Looks like it just needs the #includes to be rearranged to pass the format check (or the formatter needs to be run).

For the components which are stubbed out but disabled (e.g. generating docs, java, etc.) could you pop an issue to track them?

meson.build Show resolved Hide resolved
@nosracd nosracd merged commit 4b1f438 into lcm-proj:master Dec 23, 2024
46 checks passed
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.

3 participants