From 35eb8958f9c47b4d874f53057a24c0ee4599ff6d Mon Sep 17 00:00:00 2001 From: Michael Tao Date: Sat, 28 Mar 2026 12:13:43 -0400 Subject: [PATCH] refactor: modernize meson build to use dependency() and override_dependency() Switch zipper consumption from subproject().get_variable() to dependency() with [provide] section in wrap file. Add meson.override_dependency() for art and art-headers so downstream projects can consume them via dependency(). Remove dead code: unused dl_lib (cc.find_library('dl')) and unused TBB_dep (dependency('tbb')) that were declared but never referenced. Add viewer option to meson_options.txt for future balsa::visualization integration. --- meson.build | 11 +++-------- meson_options.txt | 1 + subprojects/zipper.wrap | 3 +++ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 13e5818..2f9a18a 100644 --- a/meson.build +++ b/meson.build @@ -9,16 +9,9 @@ spdlog_version = '>=1.9.2' -cc = meson.get_compiler('cpp') -dl_lib = cc.find_library('dl') - - spdlog_dep = dependency('spdlog', version: spdlog_version, default_options: ['tests=disabled']) -zipper_proj = subproject('zipper', default_options: {'testing': false, 'examples': false}) -zipper_dep = zipper_proj.get_variable('zipper_dep') - -TBB_dep = dependency('tbb') +zipper_dep = dependency('zipper', default_options: ['testing=false', 'examples=false']) required_deps = [zipper_dep] internal_deps = [spdlog_dep] + required_deps @@ -58,6 +51,8 @@ art_dep = declare_dependency( link_with: art_lib, dependencies: required_deps, include_directories: include_dirs) +meson.override_dependency('art', art_dep) +meson.override_dependency('art-headers', art_headers_dep) art_exec = executable('art', 'src/main.cpp', dependencies: [art_dep] + internal_deps) diff --git a/meson_options.txt b/meson_options.txt index d724c32..d6d0657 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,2 +1,3 @@ option('testing', type : 'boolean', value : true, description : 'Enable tests') option('examples', type : 'boolean', value : true, description : 'Build examples') +option('viewer', type : 'boolean', value : false, description : 'Build viewer tool via balsa::visualization') diff --git a/subprojects/zipper.wrap b/subprojects/zipper.wrap index 65c70fc..931f2c8 100644 --- a/subprojects/zipper.wrap +++ b/subprojects/zipper.wrap @@ -3,3 +3,6 @@ url = https://github.com/mtao/zipper.git # currently using this repo to dogfood, so i just want the most up-to-date version for now revision = main #revision = 55cedeeed9836f5656a607d34d770d9d364fb9ad + +[provide] +zipper = zipper_dep