Made set_option kwargs named-only.

This commit is contained in:
Jussi Pakkanen 2019-07-17 20:51:34 +03:00
parent 8a4aceef43
commit 534c95cc3e
2 changed files with 3 additions and 3 deletions

View File

@ -635,7 +635,7 @@ class CoreData:
if type(oldval) != type(value):
self.user_options[name] = value
def set_options(self, options, subproject='', warn_unknown=True):
def set_options(self, options, *, subproject='', warn_unknown=True):
# Set prefix first because it's needed to sanitize other options
prefix = self.builtins['prefix'].value
if 'prefix' in options:
@ -709,7 +709,7 @@ class CoreData:
continue
options[k] = v
self.set_options(options, subproject)
self.set_options(options, subproject=subproject)
def process_new_compiler(self, lang: str, comp, env):
from . import compilers

View File

@ -5151,7 +5151,7 @@ endian = 'little'
self.assertTrue(os.path.exists(os.path.join(pkg_dir, 'librelativepath.pc')))
env = get_fake_env(testdir, self.builddir, self.prefix)
env.coredata.set_options({'pkg_config_path': pkg_dir}, '')
env.coredata.set_options({'pkg_config_path': pkg_dir}, subproject='')
kwargs = {'required': True, 'silent': True}
relative_path_dep = PkgConfigDependency('librelativepath', env, kwargs)
self.assertTrue(relative_path_dep.found())