From 1eafc7dbf4e5268892aa1f145553691f76adc686 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Tue, 28 Jan 2025 11:41:15 -0800 Subject: [PATCH] build: automate some boehm/kj dependencies internally We will link to boehm inside of the test suite if it depends on libexpr but we don't need it for other tests. For anything linking to libexpr internally, just like externally, it needs to link to boehm. Likewise with kj and libutil (or really any lix), so we should just make it automatic. Change-Id: I2bb9ec4668e6ff741b4139fdce167f278eb71c7e --- lix/libcmd/meson.build | 1 - lix/libexpr/meson.build | 3 +++ lix/libutil/meson.build | 10 ++++++++++ tests/unit/meson.build | 4 ---- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lix/libcmd/meson.build b/lix/libcmd/meson.build index 637f5eff1..d80bb66e1 100644 --- a/lix/libcmd/meson.build +++ b/lix/libcmd/meson.build @@ -46,7 +46,6 @@ libcmd = library( liblixexpr, liblixfetchers, liblixmain, - boehm, ncurses, editline, lowdown, diff --git a/lix/libexpr/meson.build b/lix/libexpr/meson.build index e2f785a5b..9dbda5a31 100644 --- a/lix/libexpr/meson.build +++ b/lix/libexpr/meson.build @@ -295,6 +295,8 @@ install_headers( liblixexpr = declare_dependency( include_directories : include_directories('../..'), sources : libexpr_settings_header, + # Parallels the requirement to link with boehm of the pkg-config but for internal targets. + dependencies : [boehm], link_with : libexpr, ) @@ -303,6 +305,7 @@ if is_static liblixexpr_mstatic = declare_dependency( include_directories : include_directories('../..'), sources : libexpr_settings_header, + dependencies : [boehm], link_whole : libexpr, ) else diff --git a/lix/libutil/meson.build b/lix/libutil/meson.build index d27eb3e6e..d3e5daba1 100644 --- a/lix/libutil/meson.build +++ b/lix/libutil/meson.build @@ -327,6 +327,11 @@ liblixutil = declare_dependency( deprecated_features_header, libutil_settings_headers, ], + dependencies: [ + # Everything has to link to kj if it uses libutil internally (ensured by + # lix-base pkg-config externally) + kj, + ], link_with : libutil ) @@ -339,6 +344,11 @@ if is_static deprecated_features_header, libutil_settings_headers, ], + dependencies: [ + # Everything has to link to kj if it uses libutil internally (ensured by + # lix-base pkg-config externally) + kj, + ], link_whole : libutil, ) else diff --git a/tests/unit/meson.build b/tests/unit/meson.build index c839e5498..00a4eae42 100644 --- a/tests/unit/meson.build +++ b/tests/unit/meson.build @@ -33,7 +33,6 @@ libutil_test_support = library( # TODO(Qyriad): libutil tests really should not depend on libexpr... liblixexpr, rapidcheck, - boehm, ], include_directories : include_directories('libutil-support'), ) @@ -77,7 +76,6 @@ libutil_tester = executable( libasanoptions, rapidcheck, gtest, - boehm, liblixutil, liblixexpr_mstatic, liblixutil_test_support, @@ -113,7 +111,6 @@ libstore_test_support = library( liblixutil, liblixstore, rapidcheck, - boehm, kj, ], include_directories : include_directories( @@ -219,7 +216,6 @@ libexpr_tester = executable( liblixexpr_mstatic, liblixfetchers_mstatic, rapidcheck, - boehm, gtest, nlohmann_json, kj,