mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Meta: Use a common function for getting build directory
Between WPT.sh and ladybird.sh. This is useful to me as I set my default build configuration to Debug, and have been hacking around with the WPT script to align with this configuration.
This commit is contained in:
parent
16f68ab1bd
commit
7ea17d2fea
Notes:
github-actions[bot]
2024-10-09 10:32:49 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/7ea17d2fea0 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1687 Reviewed-by: https://github.com/AtkinsSJ Reviewed-by: https://github.com/tcl3 ✅
3 changed files with 31 additions and 14 deletions
|
@ -12,13 +12,18 @@ ensure_ladybird_source_dir
|
||||||
WPT_SOURCE_DIR=${WPT_SOURCE_DIR:-"${LADYBIRD_SOURCE_DIR}/Tests/LibWeb/WPT/wpt"}
|
WPT_SOURCE_DIR=${WPT_SOURCE_DIR:-"${LADYBIRD_SOURCE_DIR}/Tests/LibWeb/WPT/wpt"}
|
||||||
WPT_REPOSITORY_URL=${WPT_REPOSITORY_URL:-"https://github.com/web-platform-tests/wpt.git"}
|
WPT_REPOSITORY_URL=${WPT_REPOSITORY_URL:-"https://github.com/web-platform-tests/wpt.git"}
|
||||||
|
|
||||||
|
BUILD_PRESET=${BUILD_PRESET:-default}
|
||||||
|
|
||||||
|
BUILD_DIR=$(get_build_dir "$BUILD_PRESET")
|
||||||
|
|
||||||
default_binary_path() {
|
default_binary_path() {
|
||||||
if [ "$(uname -s)" = "Darwin" ]; then
|
if [ "$(uname -s)" = "Darwin" ]; then
|
||||||
echo "${LADYBIRD_SOURCE_DIR}/Build/ladybird/bin/Ladybird.app/Contents/MacOS/"
|
echo "${BUILD_DIR}/bin/Ladybird.app/Contents/MacOS/"
|
||||||
else
|
else
|
||||||
echo "${LADYBIRD_SOURCE_DIR}/Build/ladybird/bin/"
|
echo "${BUILD_DIR}/bin/"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
LADYBIRD_BINARY=${LADYBIRD_BINARY:-"$(default_binary_path)/Ladybird"}
|
LADYBIRD_BINARY=${LADYBIRD_BINARY:-"$(default_binary_path)/Ladybird"}
|
||||||
WEBDRIVER_BINARY=${WEBDRIVER_BINARY:-"$(default_binary_path)/WebDriver"}
|
WEBDRIVER_BINARY=${WEBDRIVER_BINARY:-"$(default_binary_path)/WebDriver"}
|
||||||
WPT_PROCESSES=${WPT_PROCESSES:-$(get_number_of_processing_units)}
|
WPT_PROCESSES=${WPT_PROCESSES:-$(get_number_of_processing_units)}
|
||||||
|
|
|
@ -95,18 +95,7 @@ cmd_with_target() {
|
||||||
|
|
||||||
ensure_ladybird_source_dir
|
ensure_ladybird_source_dir
|
||||||
|
|
||||||
# Note: Keep in sync with buildDir defaults in CMakePresets.json
|
BUILD_DIR=$(get_build_dir "$BUILD_PRESET")
|
||||||
case "${BUILD_PRESET}" in
|
|
||||||
"default")
|
|
||||||
BUILD_DIR="${LADYBIRD_SOURCE_DIR}/Build/ladybird"
|
|
||||||
;;
|
|
||||||
"Debug")
|
|
||||||
BUILD_DIR="${LADYBIRD_SOURCE_DIR}/Build/ladybird-debug"
|
|
||||||
;;
|
|
||||||
"Sanitizer")
|
|
||||||
BUILD_DIR="${LADYBIRD_SOURCE_DIR}/Build/ladybird-sanitizers"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
CMAKE_ARGS+=("-DCMAKE_INSTALL_PREFIX=$LADYBIRD_SOURCE_DIR/Build/ladybird-install-${BUILD_PRESET}")
|
CMAKE_ARGS+=("-DCMAKE_INSTALL_PREFIX=$LADYBIRD_SOURCE_DIR/Build/ladybird-install-${BUILD_PRESET}")
|
||||||
|
|
||||||
|
|
|
@ -60,3 +60,26 @@ ensure_ladybird_source_dir() {
|
||||||
export LADYBIRD_SOURCE_DIR
|
export LADYBIRD_SOURCE_DIR
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_build_dir() {
|
||||||
|
ensure_ladybird_source_dir
|
||||||
|
|
||||||
|
# Note: Keep in sync with buildDir defaults in CMakePresets.json
|
||||||
|
case "$1" in
|
||||||
|
"default")
|
||||||
|
BUILD_DIR="${LADYBIRD_SOURCE_DIR}/Build/ladybird"
|
||||||
|
;;
|
||||||
|
"Debug")
|
||||||
|
BUILD_DIR="${LADYBIRD_SOURCE_DIR}/Build/ladybird-debug"
|
||||||
|
;;
|
||||||
|
"Sanitizer")
|
||||||
|
BUILD_DIR="${LADYBIRD_SOURCE_DIR}/Build/ladybird-sanitizers"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown BUILD_PRESET: '$1'" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "${BUILD_DIR}"
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue