Skip to content
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

subproject()'s default_options doesn't accept feature options #14048

Open
lorcap opened this issue Dec 27, 2024 · 1 comment
Open

subproject()'s default_options doesn't accept feature options #14048

lorcap opened this issue Dec 27, 2024 · 1 comment

Comments

@lorcap
Copy link

lorcap commented Dec 27, 2024

With meson 1.6.0, the following statement:

ft = get_option('feature')
subproject('sub', default_options: { 'ft': ft })

results in the following error:

subproject keyword argument 'default_options' was of type dict[UserFeatureOption] but should have been one of: str, array[str], dict[str | int | bool | list]

when feature is a feature option.

It should be possible to pass a feature option value as it happens for string, combo, boolean, and integer (with .to_string()).

@lorcap
Copy link
Author

lorcap commented Dec 27, 2024

In the meantime, the following workaround can be used:

ft = get_option('feature')

if ft.enabled()
  ft_str = 'enabled'
elif ft.disabled()
  ft_str = 'disabled'
else
  ft_str = 'auto'
endif

subproject('sub', default_options: { 'ft': ft })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant