aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/cython.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2024-04-14 12:58:30 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2025-02-13 15:26:44 +0200
commit518c732ea9b0f1975f6f28accff3286be4106538 (patch)
tree2be9544828545a2f9f0676efc6eb82ac197ec4bd /mesonbuild/compilers/cython.py
parentea678ed82938ceac00682b2695b57193d36b71b4 (diff)
downloadmeson-optionrefactor3.zip
meson-optionrefactor3.tar.gz
meson-optionrefactor3.tar.bz2
Make all Meson level options overridable per subproject.optionrefactor3
Diffstat (limited to 'mesonbuild/compilers/cython.py')
-rw-r--r--mesonbuild/compilers/cython.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/mesonbuild/compilers/cython.py b/mesonbuild/compilers/cython.py
index ed0ab31..27cad55 100644
--- a/mesonbuild/compilers/cython.py
+++ b/mesonbuild/compilers/cython.py
@@ -11,8 +11,9 @@ from ..mesonlib import EnvironmentException, version_compare
from .compilers import Compiler
if T.TYPE_CHECKING:
- from ..coredata import MutableKeyedOptionDictType, KeyedOptionDictType
+ from ..coredata import MutableKeyedOptionDictType
from ..environment import Environment
+ from ..build import BuildTarget
class CythonCompiler(Compiler):
@@ -85,13 +86,14 @@ class CythonCompiler(Compiler):
return opts
- def get_option_compile_args(self, options: 'KeyedOptionDictType') -> T.List[str]:
+ def get_option_compile_args(self, target: 'BuildTarget', env: 'Environment', subproject: T.Optional[str] = None) -> T.List[str]:
args: T.List[str] = []
- key = self.form_compileropt_key('version')
- version = options.get_value(key)
+ version = self.get_compileropt_value('version', env, target, subproject)
+ assert isinstance(version, str)
args.append(f'-{version}')
- key = self.form_compileropt_key('language')
- lang = options.get_value(key)
+
+ lang = self.get_compileropt_value('language', env, target, subproject)
+ assert isinstance(lang, str)
if lang == 'cpp':
args.append('--cplus')
return args