Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit13c58ca

Browse files
committed
meson: Add dependency lookups via names used by cmake
Particularly on windows it's useful to look up dependencies via cmake, insteadof pkg-config. Meson supports doing so. Unfortunately the dependency namesused by various projects often differs between their pkg-config and cmakefiles.This would look a lot neater if we could rely on meson >= 0.60.0...Reviewed-by: Tristan Partin <tristan@partin.io>Discussion:https://postgr.es/m/20240709065101.xhc74r3mdg2lmn4w@awork3.anarazel.deBackpatch: 16-, where meson support was added
1 parent793a5be commit13c58ca

File tree

1 file changed

+40
-6
lines changed

1 file changed

+40
-6
lines changed

‎meson.build

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -819,11 +819,25 @@ endif
819819

820820
icuopt=get_option('icu')
821821
ifnot icuopt.disabled()
822-
icu=dependency('icu-uc',required: icuopt)
823-
icu_i18n=dependency('icu-i18n',required: icuopt)
822+
icu=dependency('icu-uc',required:false)
823+
if icu.found()
824+
icu_i18n=dependency('icu-i18n',required:true)
825+
endif
826+
827+
# Unfortunately the dependency is named differently with cmake
828+
ifnot icu.found()# combine with above once meson 0.60.0 is required
829+
icu=dependency('ICU',required: icuopt,
830+
components: ['uc'],modules: ['ICU::uc'],method:'cmake')
831+
if icu.found()
832+
icu_i18n=dependency('ICU',required:true,
833+
components: ['i18n'],modules: ['ICU::i18n'])
834+
endif
835+
endif
824836

825837
if icu.found()
826838
cdata.set('USE_ICU',1)
839+
else
840+
icu_i18n= not_found_dep
827841
endif
828842

829843
else
@@ -839,7 +853,12 @@ endif
839853

840854
libxmlopt=get_option('libxml')
841855
ifnot libxmlopt.disabled()
842-
libxml=dependency('libxml-2.0',required: libxmlopt,version:'>= 2.6.23')
856+
libxml=dependency('libxml-2.0',required:false,version:'>= 2.6.23')
857+
# Unfortunately the dependency is named differently with cmake
858+
ifnot libxml.found()# combine with above once meson 0.60.0 is required
859+
libxml=dependency('LibXml2',required: libxmlopt,version:'>= 2.6.23',
860+
method:'cmake')
861+
endif
843862

844863
if libxml.found()
845864
cdata.set('USE_LIBXML',1)
@@ -856,7 +875,11 @@ endif
856875

857876
libxsltopt=get_option('libxslt')
858877
ifnot libxsltopt.disabled()
859-
libxslt=dependency('libxslt',required: libxsltopt)
878+
libxslt=dependency('libxslt',required:false)
879+
# Unfortunately the dependency is named differently with cmake
880+
ifnot libxslt.found()# combine with above once meson 0.60.0 is required
881+
libxslt=dependency('LibXslt',required: libxsltopt,method:'cmake')
882+
endif
860883

861884
if libxslt.found()
862885
cdata.set('USE_LIBXSLT',1)
@@ -873,7 +896,13 @@ endif
873896

874897
lz4opt=get_option('lz4')
875898
ifnot lz4opt.disabled()
876-
lz4=dependency('liblz4',required: lz4opt)
899+
lz4=dependency('liblz4',required:false)
900+
# Unfortunately the dependency is named differently with cmake
901+
ifnot lz4.found()# combine with above once meson 0.60.0 is required
902+
lz4=dependency('lz4',required: lz4opt,
903+
method:'cmake',modules: ['LZ4::lz4_shared'],
904+
)
905+
endif
877906

878907
if lz4.found()
879908
cdata.set('USE_LZ4',1)
@@ -1498,7 +1527,12 @@ endif
14981527

14991528
zstdopt=get_option('zstd')
15001529
ifnot zstdopt.disabled()
1501-
zstd=dependency('libzstd',required: zstdopt,version:'>=1.4.0')
1530+
zstd=dependency('libzstd',required:false,version:'>=1.4.0')
1531+
# Unfortunately the dependency is named differently with cmake
1532+
ifnot zstd.found()# combine with above once meson 0.60.0 is required
1533+
zstd=dependency('zstd',required: zstdopt,version:'>=1.4.0',
1534+
method:'cmake',modules: ['zstd::libzstd_shared'])
1535+
endif
15021536

15031537
if zstd.found()
15041538
cdata.set('USE_ZSTD',1)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp