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

Add meson build system for C++ #41

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add meson build system for C++ #41

wants to merge 1 commit into from

Conversation

bonimy
Copy link

@bonimy bonimy commented Jun 3, 2022

I'm writing a project using meson as the build system as sphgeom
happens to be a dependence. There were a few issues trying to build with
cmake and I found it easier to just add meson support.

'UnitVector3d.cc',
'utils.cc',
'Vector3d.cc']
sphgeom = static_library(

Choose a reason for hiding this comment

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

Why a static library, particularly? If you just use library() it becomes the choice of the builder (via -Ddefault_library=static, but it also accepts =both to build both at the same time).

The cmake build uses shared, not static, though cmake doesn't really have a good way to choose between the two.


subdir('src')

pkg_mod = import('pkgconfig')

Choose a reason for hiding this comment

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

In addition to creating a pkg-config file, you may also want to create a declare_dependency() that adds the incdir and the sphgeom library, as an interface, which then allows using this meson.build as a Meson subproject with automatic dependency fallback.

Comment on lines +1 to +5
incdir = include_directories('../include/')

install_headers(
'../include/lsst/sphgeom/Angle.h',
'../include/lsst/sphgeom/AngleInterval.h',

Choose a reason for hiding this comment

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

Personally, I would define this in subdir('include') so you don't need all these ../ everywhere. :)

@bonimy bonimy force-pushed the meson branch 3 times, most recently from 2c4f45a to 8a2e1e1 Compare June 3, 2022 03:20
@bonimy
Copy link
Author

bonimy commented Aug 11, 2022

Just bumping to say that I've been in the process of moving states, but I'll hopefully finish this PR soon once things settle down.

I'm writing a project using meson as the build system as sphgeom
happens to be a dependence. There were a few issues trying to build with
cmake and I found it easier to just add meson support.
@timj
Copy link
Member

timj commented Aug 16, 2024

I rebased this PR just in case there is still interest in it.

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