nixpkgs delivered us the untimely gift of a meson 1.5 upgrade, which *does* make our lives easier by allowing us to delete wrap generation code, but it does so at the cost of renaming all rust crates in such a way that the wrap logic cannot tolerate the new names on the old meson version 😭. It also means that support burden for this is going to be atrocious until we either give in and vendor meson 1.5 or we make a CI target for it. Neither seems appealing, though the latter is not super absurd for ensuring we don't break nixpkgs unstable. This commit causes meson 1.5 to ignore the .wrap files in subprojects/ entirely (since they have the wrong names lol) and instead use Cargo.lock, so it now hard-depends on our workspace reshuffling improvement. It also deletes the hack that we were using to get the sources of Cargo deps into meson by using a feature that went unnoticed when this code was originally written: MESON_PACKAGE_CACHE_DIR: https://github.com/mesonbuild/meson/blob/8a202de6ec763284cbb7160b9d43d5e7e0703f19/mesonbuild/wrap/wrap.py#L490-L502 Change-Id: I7a28f12fc2812c6ed7537b60bc3025c141a05874
34 lines
978 B
Meson
34 lines
978 B
Meson
# The external crate rowan has an ambiguous pointer comparison warning, which
|
|
# we don't want to fail our whole build if werror is on.
|
|
# FIXME: remove hack once we get rid of meson 1.4
|
|
rnix_name = 'rnix-0.11-rs'
|
|
rowan_name = 'rowan-0.15-rs'
|
|
if meson.version().version_compare('< 1.5')
|
|
rnix_name = 'rnix-rs'
|
|
rowan_name = 'rowan-rs'
|
|
endif
|
|
|
|
subproject(rowan_name, default_options : ['werror=false'])
|
|
|
|
rnix = dependency(rnix_name)
|
|
rowan = dependency(rowan_name)
|
|
|
|
lix_doc = static_library(
|
|
'lix_doc',
|
|
sources : files('src/lib.rs'),
|
|
rust_abi : 'c',
|
|
dependencies : [
|
|
rowan,
|
|
rnix,
|
|
],
|
|
# If an installed static library depends on this target, then Meson will force
|
|
# that to link with `-Wl,--whole-archive`, unless we also install this target.
|
|
# `-Wl,--whole-archive` can cause some Problems when linking multiple nested
|
|
# static libraries, so let's just install the damn thing.
|
|
install : true,
|
|
)
|
|
|
|
liblix_doc = declare_dependency(
|
|
link_with : lix_doc,
|
|
)
|