mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
Meta: Add clean command to ladybird.py
This commit is contained in:
parent
bfc0715455
commit
56fd109252
Notes:
github-actions[bot]
2025-05-21 17:36:33 +00:00
Author: https://github.com/ayeteadoe
Commit: 56fd109252
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4742
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/R-Goc
Reviewed-by: https://github.com/trflynn89
1 changed files with 12 additions and 0 deletions
|
@ -113,6 +113,8 @@ def main(platform):
|
|||
subparsers.add_parser('vcpkg', help='Ensure that dependencies are available',
|
||||
parents=[preset_parser, compiler_parser])
|
||||
|
||||
subparsers.add_parser('clean', help='Cleans the build environment', parents=[preset_parser, compiler_parser])
|
||||
|
||||
args = parser.parse_args()
|
||||
kwargs = vars(args)
|
||||
command = kwargs.pop('command', None)
|
||||
|
@ -162,6 +164,8 @@ def main(platform):
|
|||
elif command == 'vcpkg':
|
||||
_configure_build_env(**kwargs)
|
||||
_build_vcpkg()
|
||||
elif command == 'clean':
|
||||
_clean_main(**kwargs)
|
||||
|
||||
|
||||
def _configure_main(platform, **kwargs):
|
||||
|
@ -424,6 +428,14 @@ def _debug_main(host_system, build_dir, **kwargs):
|
|||
sys.exit(1)
|
||||
|
||||
|
||||
def _clean_main(**kwargs):
|
||||
lb_source_dir, build_preset_dir, _ = _configure_build_env(**kwargs)
|
||||
shutil.rmtree(str(build_preset_dir), ignore_errors=True)
|
||||
|
||||
user_vars_cmake_module = lb_source_dir.joinpath('Meta', 'CMake', 'vcpkg', 'user-variables.cmake')
|
||||
user_vars_cmake_module.unlink(missing_ok=True)
|
||||
|
||||
|
||||
def _print_process_stderr(e, msg):
|
||||
err_details = f': {e.stderr}' if e.stderr else ''
|
||||
print(f'{msg}{err_details}', file=sys.stderr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue