Add PGO build for Win and Mac

This commit is contained in:
klzgrad 2020-08-29 22:07:27 +08:00
parent 0c40902920
commit e9ff6f6092
2 changed files with 31 additions and 0 deletions

View File

@ -82,6 +82,20 @@ if [ "$(uname)" = Linux ]; then
fi fi
fi fi
case "$(uname)" in
MINGW*|MSYS*)
case "$(uname -m)" in
x86_64) PGO_NAME=win64;;
*) PGO_NAME=win32;;
esac;;
Darwin) PGO_NAME=mac;;
esac
if [ "$PGO_NAME" ]; then
profile=$(cat chrome/build/$PGO_NAME.pgo.txt)
flags="$flags
pgo_data_path=\"../../chrome/build/pgo_profiles/$profile\""
fi
rm -rf "./$out" rm -rf "./$out"
mkdir -p out mkdir -p out

View File

@ -47,6 +47,23 @@ if [ "$ARCH" = Linux -a ! -f chrome/android/profiles/afdo.prof ]; then
curl "$afdo_url" | bzip2 -cd >chrome/android/profiles/afdo.prof curl "$afdo_url" | bzip2 -cd >chrome/android/profiles/afdo.prof
fi fi
# Profiles (Windows, Mac)
case "$ARCH" in
Windows)
case "$(uname -m)" in
x86_64) PGO_NAME=win64;;
*) PGO_NAME=win32;;
esac;;
Darwin) PGO_NAME=mac;;
esac
if [ "$PGO_NAME" ]; then
mkdir -p chrome/build/pgo_profiles
profile=$(cat chrome/build/$PGO_NAME.pgo.txt)
cd chrome/build/pgo_profiles
curl -LO "https://storage.googleapis.com/chromium-optimization-profiles/pgo_profiles/$profile"
cd ../../..
fi
# dsymutil (Mac) # dsymutil (Mac)
if [ "$ARCH" = Darwin ]; then if [ "$ARCH" = Darwin ]; then
mkdir -p tools/clang/dsymutil mkdir -p tools/clang/dsymutil