Conversation
kelson42
commented
Oct 27, 2025
- Fix handling of libicu 76+
- Simplify a bit the handling of all deps
meson.build
Outdated
| all_deps = [thread_dep, xapian_dep, lzma_dep, zstd_dep, win_deps] | ||
|
|
||
| # Dependencies as array | ||
| all_deps += libicu_deps |
There was a problem hiding this comment.
libicu_deps → icu_deps
| endif | ||
|
|
||
| # Dependencies as string | ||
| all_deps = [thread_dep, xapian_dep, lzma_dep, zstd_dep, win_deps] |
There was a problem hiding this comment.
xapian_dep must be included conditionally
There was a problem hiding this comment.
It is already conditional because empty if not requested.
| if xapian_dep.found() | ||
| icu_dep = dependency('icu-i18n', static:static_linkage) | ||
| if icu_dep.version().version_compare('>= 76') | ||
| icu_dep = [icu_dep, dependency('icu-uc', static:static_linkage)] | ||
| icu_deps = [icu_dep, dependency('icu-uc', static:static_linkage)] | ||
| else | ||
| icu_deps = [icu_dep] | ||
| endif | ||
| else | ||
| icu_dep = dependency('icu-i18n', 'required:false', static:static_linkage) | ||
| if icu_dep.version().version_compare('>= 76') | ||
| icu_dep = [icu_dep, dependency('icu-uc', 'required:false', static:static_linkage)] | ||
| icu_deps = [icu_dep, dependency('icu-uc', 'required:false', static:static_linkage)] | ||
| else | ||
| icu_deps = [icu_dep] | ||
| endif | ||
| endif |
There was a problem hiding this comment.
I think that we can avoid the duplication between the positive and negative branches of this if, by introducing a variable icu_dep_is_required = xapian_dep.found()
There was a problem hiding this comment.
I have done it differently but the idea is the same: simplification
There was a problem hiding this comment.
But your change works differently. Before, if xapian was not found, icu participated as an optional dependency, whereas now in that case it is simply skipped.
|
@veloman-yunkan Sorry, I was not over |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| if target_machine.system() == 'freebsd' | ||
| deps += [execinfo_dep] | ||
| endif |
There was a problem hiding this comment.
The variable deps was replaced with all_deps and could have been deleted altogether, however this piece of code means that something was overlooked
| if xapian_dep.found() | ||
| icu_dep = dependency('icu-i18n', static:static_linkage) | ||
| if icu_dep.version().version_compare('>= 76') | ||
| icu_dep = [icu_dep, dependency('icu-uc', static:static_linkage)] | ||
| icu_deps = [icu_dep, dependency('icu-uc', static:static_linkage)] | ||
| else | ||
| icu_deps = [icu_dep] | ||
| endif | ||
| else | ||
| icu_dep = dependency('icu-i18n', 'required:false', static:static_linkage) | ||
| if icu_dep.version().version_compare('>= 76') | ||
| icu_dep = [icu_dep, dependency('icu-uc', 'required:false', static:static_linkage)] | ||
| icu_deps = [icu_dep, dependency('icu-uc', 'required:false', static:static_linkage)] | ||
| else | ||
| icu_deps = [icu_dep] | ||
| endif | ||
| endif |
There was a problem hiding this comment.
But your change works differently. Before, if xapian was not found, icu participated as an optional dependency, whereas now in that case it is simply skipped.