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
This commit is contained in:
Jade Lovelace
2025-01-28 12:19:00 -08:00
parent 750f6e327c
commit 1eafc7dbf4
4 changed files with 13 additions and 5 deletions
-1
View File
@@ -46,7 +46,6 @@ libcmd = library(
liblixexpr,
liblixfetchers,
liblixmain,
boehm,
ncurses,
editline,
lowdown,
+3
View File
@@ -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
+10
View File
@@ -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
-4
View File
@@ -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,