Skip to content

Commit 7346c0f

Browse files
committed
libsleefquad comes from sleef
1 parent 5a41cef commit 7346c0f

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

quaddtype/meson.build

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,24 @@ endif
1616
qblas_dep = dependency('qblas', fallback: ['qblas', 'qblas_dep'])
1717

1818
# Try to find SLEEF system-wide first, fall back to subproject if not found
19-
sleef_dep = dependency('sleef', fallback: ['sleef', 'sleef_dep'])
20-
sleefquad_dep = dependency('sleefquad', fallback: ['sleef', 'sleefquad_dep'])
19+
sleef_dep = dependency('sleef', fallback: ['sleef', 'sleef_dep'], required: false)
20+
21+
if sleef_dep.found() and sleef_dep.type_name() != 'internal'
22+
# SLEEF found system-wide - both sleef and sleefquad are typically in the same installation
23+
# Create sleefquad dependency manually since it's not always exposed as a separate component
24+
cpp = meson.get_compiler('cpp')
25+
sleefquad_lib = cpp.find_library('sleefquad', required: true)
26+
sleefquad_dep = declare_dependency(
27+
dependencies: [sleef_dep, sleefquad_lib]
28+
)
29+
message('Using system-wide SLEEF installation')
30+
else
31+
# Fall back to subproject which provides both dependencies
32+
sleef_subproj = subproject('sleef')
33+
sleef_dep = sleef_subproj.get_variable('sleef_dep')
34+
sleefquad_dep = sleef_subproj.get_variable('sleefquad_dep')
35+
message('Using SLEEF subproject')
36+
endif
2137

2238
incdir_numpy = run_command(py,
2339
['-c', 'import numpy; print(numpy.get_include())'],

0 commit comments

Comments
 (0)