Skip to content

Commit 23950e3

Browse files
committed
Update meataxe dependency handling for pkg-config
1 parent 8a0d156 commit 23950e3

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/meson.build

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,16 @@ if not m4rie.found()
148148
# For some reason, m4rie is not found via pkg-config on some systems (eg Conda)
149149
m4rie = cc.find_library('m4rie', required: not is_windows, disabler: true)
150150
endif
151-
# Cannot be found via pkg-config
152-
mtx = cc.find_library(
153-
'mtx',
154-
required: false,
155-
disabler: true,
156-
has_headers: ['meataxe.h'],
157-
)
151+
mtx = dependency('mtx', required: false)
152+
if not mtx.found()
153+
# fallback for older versions without pkg-config
154+
mtx = cc.find_library(
155+
'mtx',
156+
required: false,
157+
disabler: true,
158+
has_headers: ['meataxe.h'],
159+
)
160+
endif
158161
png = dependency(['libpng', 'png', 'png16'], version: '>=1.2')
159162
zlib = dependency('zlib', version: '>=1.2.11')
160163
# We actually want >= 20231212, but the version number is not updated in the pkgconfig

0 commit comments

Comments
 (0)