aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/scalapack.py
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-01-10 19:02:12 -0600
committerEli Schwartz <eschwartz93@gmail.com>2022-05-03 23:03:56 -0400
commit557680f7d6b2a2e7c3d0f04fb0d6529ac7a6d475 (patch)
treededf300cdb4b39a83e7bfa9eb7720f7fb43f0352 /mesonbuild/dependencies/scalapack.py
parent8b3a54e5085933b78a8509103a76bed7ca8cdde4 (diff)
downloadmeson-557680f7d6b2a2e7c3d0f04fb0d6529ac7a6d475.zip
meson-557680f7d6b2a2e7c3d0f04fb0d6529ac7a6d475.tar.gz
meson-557680f7d6b2a2e7c3d0f04fb0d6529ac7a6d475.tar.bz2
add prefer_static built-in option
By default, meson will try to look for shared libraries first before static ones. In the meson.build itself, one can use the static keyword to control if a static library will be tried first but there's no simple way for an end user performing a build to switch back and forth at will. Let's cover this usecase by adding an option that allows a user to specify if they want dependency lookups to try static or shared libraries first. The writer of the meson.build can manually specify the static keyword where appropriate which will override the value of this option.
Diffstat (limited to 'mesonbuild/dependencies/scalapack.py')
-rw-r--r--mesonbuild/dependencies/scalapack.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/dependencies/scalapack.py b/mesonbuild/dependencies/scalapack.py
index 707e698..656978d 100644
--- a/mesonbuild/dependencies/scalapack.py
+++ b/mesonbuild/dependencies/scalapack.py
@@ -17,6 +17,7 @@ import functools
import os
import typing as T
+from ..mesonlib import OptionKey
from .base import DependencyMethods
from .base import DependencyException
from .cmake import CMakeDependency
@@ -35,7 +36,8 @@ def scalapack_factory(env: 'Environment', for_machine: 'MachineChoice',
candidates: T.List['DependencyGenerator'] = []
if DependencyMethods.PKGCONFIG in methods:
- mkl = 'mkl-static-lp64-iomp' if kwargs.get('static', False) else 'mkl-dynamic-lp64-iomp'
+ static_opt = kwargs.get('static', env.coredata.get_option(OptionKey('prefer_static')))
+ mkl = 'mkl-static-lp64-iomp' if static_opt else 'mkl-dynamic-lp64-iomp'
candidates.append(functools.partial(
MKLPkgConfigDependency, mkl, env, kwargs))