mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
Meta: Support running ladybird with arguments from serenity.sh
You may now, for example, run: ./Meta/serenity.sh run lagom ladybird https://serenityos.org
This commit is contained in:
parent
9743445e44
commit
ad8183beb4
Notes:
sideshowbarker
2024-07-17 06:38:11 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/ad8183beb4 Pull-request: https://github.com/SerenityOS/serenity/pull/17172 Reviewed-by: https://github.com/ADKaster
@ -116,8 +116,9 @@ if (ANDROID)
|
||||
endif()
|
||||
|
||||
add_custom_target(run${LADYBIRD_CUSTOM_TARGET_SUFFIX}
|
||||
COMMAND "${CMAKE_COMMAND}" -E env "SERENITY_SOURCE_DIR=${SERENITY_SOURCE_DIR}" "$<TARGET_FILE:ladybird>"
|
||||
COMMAND "${CMAKE_COMMAND}" -E env "SERENITY_SOURCE_DIR=${SERENITY_SOURCE_DIR}" "$<TARGET_FILE:ladybird>" $ENV{LAGOM_ARGS}
|
||||
USES_TERMINAL
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_custom_target(debug${LADYBIRD_CUSTOM_TARGET_SUFFIX}
|
||||
|
@ -402,6 +402,7 @@ run_gdb() {
|
||||
}
|
||||
|
||||
build_and_run_lagom_target() {
|
||||
local run_target="${1}"
|
||||
local lagom_target="${CMD_ARGS[0]}"
|
||||
local lagom_args
|
||||
|
||||
@ -415,7 +416,7 @@ build_and_run_lagom_target() {
|
||||
# Then existing list separators must be replaced with a semicolon for CMake.
|
||||
lagom_args=$(IFS=';' ; echo -e "${cmd_args[*]}")
|
||||
|
||||
LAGOM_TARGET="${lagom_target}" LAGOM_ARGS="${lagom_args[*]}" build_target "run-lagom-target"
|
||||
LAGOM_TARGET="${lagom_target}" LAGOM_ARGS="${lagom_args[*]}" build_target "${run_target}"
|
||||
}
|
||||
|
||||
if [[ "$CMD" =~ ^(build|install|image|copy-src|run|gdb|test|rebuild|recreate|kaddr2line|addr2line|setup-and-run)$ ]]; then
|
||||
@ -447,10 +448,9 @@ if [[ "$CMD" =~ ^(build|install|image|copy-src|run|gdb|test|rebuild|recreate|kad
|
||||
run)
|
||||
if [ "$TARGET" = "lagom" ]; then
|
||||
if [ "${CMD_ARGS[0]}" = "ladybird" ]; then
|
||||
build_target "${CMD_ARGS[0]}"
|
||||
ninja -C "$BUILD_DIR" run-ladybird
|
||||
build_and_run_lagom_target "run-ladybird"
|
||||
else
|
||||
build_and_run_lagom_target
|
||||
build_and_run_lagom_target "run-lagom-target"
|
||||
fi
|
||||
else
|
||||
build_target
|
||||
|
Loading…
Reference in New Issue
Block a user