Skip to content

Commit

Permalink
Allow setting build_by_default to False when install is True
Browse files Browse the repository at this point in the history
Allow setting build_by_default to False even when install
is True. An improper code check for the default case accidently
covered also the case in which the value is explicitly being
passed by the user, causing the user's value to be ignored.

Resolves #13498.

Signed-off-by: Eyal Itkin <[email protected]>
  • Loading branch information
Eyal Itkin committed Nov 23, 2024
1 parent 9f3f88f commit 4c933db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mesonbuild/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ def process_kwargs_base(self, kwargs: T.Dict[str, T.Any]) -> None:
if not isinstance(self.build_by_default, bool):
raise InvalidArguments('build_by_default must be a boolean value.')

if not self.build_by_default and kwargs.get('install', False):
elif not self.build_by_default and kwargs.get('install', False):
# For backward compatibility, if build_by_default is not explicitly
# set, use the value of 'install' if it's enabled.
self.build_by_default = True
Expand Down
1 change: 1 addition & 0 deletions test cases/common/129 build by default/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ executable('fooprog', 'foo.c',

executable('barprog', 'foo.c',
build_by_default : false,
install : true,
)

comp = files('mygen.py')
Expand Down

0 comments on commit 4c933db

Please sign in to comment.