From cf5f1a6dcbf23f6bbbc68462c2d73e7a792ebbe0 Mon Sep 17 00:00:00 2001 From: Emily Boudreaux Date: Sat, 21 Jun 2025 05:59:32 -0400 Subject: [PATCH] build(pkg-config): added easy pkg-config generation --- meson.build | 11 +++++++++++ readme.md | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/meson.build b/meson.build index 08c324b..625f3e1 100644 --- a/meson.build +++ b/meson.build @@ -33,3 +33,14 @@ subdir('assets/static') subdir('src') subdir('tests') +pkg = import('pkgconfig') +pkg.generate( + name: 'libconstants', + description: 'Physical Constants for SERiF and related projects', + version: meson.project_version(), + libraries: [libconst], + subdirs: ['libconstants'], + filebase: 'libconstants', + install_dir: join_paths(get_option('libdir'), 'pkgconfig') +) + diff --git a/readme.md b/readme.md index cca6659..c7155d4 100644 --- a/readme.md +++ b/readme.md @@ -3,3 +3,21 @@ libconstants is the authoritative source for physical constants for the SERiF project. This has been broken out of the main serif project to allow for more modularity + +## Building +In order to build libconstants you need `meson>=1.5.0`. This can be installed with `pip` + +```bash +pip install "meson>=1.5.0" +``` + +Then from the root libconstants directory it is as simple as + +```bash +meson setup build --buildtype=release +meson compile -C build +meson test -C build +``` + +this will auto generate a pkg-config file for you so that linking other libraries to libconstants is easy. +