Skip to content

Meson: use pkg-config for more libraries #40577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions src/sage/graphs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@ if cc.has_header('mcqd.h')
else
mcqd = disabler()
endif
cliquer = cc.find_library('cliquer', required: not is_windows, disabler: true)

# Cannot be found via pkg-config
planarity = cc.find_library(
'planarity',
required: not is_windows,
disabler: true,
)
cliquer = dependency('libcliquer', required: false, disabler: true)
if not cliquer.found()
# fallback for older versions without pkg-config
cliquer = cc.find_library('cliquer', required: not is_windows, disabler: true)
endif

planarity = dependency('libplanarity', required: false, disabler: true)
if not planarity.found()
# fallback for older versions without pkg-config
planarity = cc.find_library(
'planarity',
required: not is_windows,
disabler: true,
)
endif

py.install_sources(
'__init__.py',
Expand Down
22 changes: 15 additions & 7 deletions src/sage/libs/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
sirocco = cc.find_library('sirocco', required: false, disabler: true)
sirocco = dependency('libsirocco', required: false, disabler: true)
if not sirocco.found()
# fallback for older versions without pkg-config
sirocco = cc.find_library('sirocco', required: false, disabler: true)
endif
# cannot be found via pkg-config
ecl = cc.find_library('ecl', required: false, disabler: true)
if not ecl.found() and not is_windows
Expand Down Expand Up @@ -77,12 +81,16 @@ gc = dependency(
required: not is_windows,
disabler: true,
)
homfly = cc.find_library(
'homfly',
has_headers: ['homfly.h'],
required: false,
disabler: true,
)
homfly = dependency('libhomfly', required: false, disabler: true)
if not homfly.found()
# fallback for older versions without pkg-config
homfly = cc.find_library(
'homfly',
has_headers: ['homfly.h'],
required: false,
disabler: true,
)
endif

py.install_sources(
'__init__.py',
Expand Down
15 changes: 9 additions & 6 deletions src/sage/libs/symmetrica/meson.build
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Cannot be found by pkg-config
symmetrica = cc.find_library(
'symmetrica',
required: not is_windows,
disabler: true,
)
symmetrica = dependency('symmetrica', required: false, disabler: true)
if not symmetrica.found()
# fallback for older versions without pkg-config
symmetrica = cc.find_library(
'symmetrica',
required: not is_windows,
disabler: true,
)
endif

py.install_sources('__init__.py', 'all.py', subdir: 'sage/libs/symmetrica')

Expand Down
6 changes: 5 additions & 1 deletion src/sage/rings/polynomial/pbori/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
brial = cc.find_library('brial', required: false, disabler: true)
brial = dependency('brial', required: false, disabler: true)
if not brial.found()
# fallback for older versions without pkg-config
brial = cc.find_library('brial', required: false, disabler: true)
endif
# Cannot be found via pkg-config
brial_groebner = cc.find_library(
'brial_groebner',
Expand Down
Loading