Bring back pgo option in new build package script

This commit is contained in:
Francesco Abbate 2021-09-05 15:43:22 +02:00
parent 38d85f2483
commit f69e42a43c
2 changed files with 24 additions and 1 deletions

View File

@ -25,6 +25,8 @@ show_help() {
echo "-f --forcefallback Force to build subprojects dependencies statically."
echo "-B --bundle Create an App bundle (macOS only)"
echo "-P --portable Create a portable package."
echo "-O --pgo Use profile guided optimizations (pgo)."
echo " Requires running the application iteractively."
echo
echo "Package options:"
echo
@ -55,6 +57,7 @@ main() {
local bundle
local innosetup
local portable
local pgo
for i in "$@"; do
case $i in
@ -110,6 +113,10 @@ main() {
source="--source"
shift
;;
-O|--pgo)
pgo="--pgo"
shift
;;
--debug)
debug="--debug"
set -x
@ -137,7 +144,8 @@ main() {
$debug \
$force_fallback \
$bundle \
$portable
$portable \
$pgo
source scripts/package.sh \
${build_dir_option[@]} \

View File

@ -21,6 +21,7 @@ show_help() {
echo "-p --prefix PREFIX Install directory prefix. Default: '/'."
echo "-B --bundle Create an App bundle (macOS only)"
echo "-P --portable Create a portable binary package."
echo "-O --pgo Use profile guided optimizations (pgo)."
echo " macOS: disabled when used with --bundle,"
echo " Windows: Implicit being the only option."
echo
@ -33,6 +34,7 @@ main() {
local force_fallback
local bundle
local portable
local pgo
for i in "$@"; do
case $i in
@ -70,6 +72,10 @@ main() {
portable="-Dportable=true"
shift
;;
-O|--pgo)
pgo="-Db_pgo=generate"
shift
;;
*)
# unknown option
;;
@ -94,9 +100,18 @@ main() {
$force_fallback \
$bundle \
$portable \
$pgo \
"${build_dir}"
meson compile -C "${build_dir}"
if [ ! -z ${pgo+x} ]; then
cp -r data "${build_dir}/src"
"${build_dir}/src/lite-xl"
meson configure -Db_pgo=use "${build_dir}"
meson compile -C "${build_dir}"
rm -fr "${build_dir}/data"
fi
}
main "$@"