Support win32 build

Also use sccache releases instead of building with cargo.
This commit is contained in:
klzgrad 2019-04-02 23:16:57 +08:00 committed by GitHub
parent 0f66be50dd
commit 3a786e6bb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 15 deletions

View file

@ -2,19 +2,21 @@ branches:
except: except:
- dev - dev
version: '{build}' version: '{build}'
platform:
- x64
- x86
image: Visual Studio 2017 image: Visual Studio 2017
install: install:
- cinst ninja - cinst ninja
cache: cache:
- '%USERPROFILE%\.cargo\bin'
- '%LOCALAPPDATA%\Mozilla\sccache' - '%LOCALAPPDATA%\Mozilla\sccache'
build_script: build_script:
- bash ./tools/import-upstream.sh - bash ./tools/import-upstream.sh
- bash -c 'cd src; ./get-clang.sh' - bash -c 'cd src; ./get-clang.sh'
- bash -c '~/.cargo/bin/sccache -s' - bash -c '~/.cargo/bin/sccache -s'
- bash -c 'cd src; ./build.sh' - bash -c 'cd src; EXTRA_FLAGS=target_cpu=\"$PLATFORM\" ./build.sh'
- bash -c '~/.cargo/bin/sccache -s' - bash -c '~/.cargo/bin/sccache -s'
- ps: $env:BUILD_NAME="naiveproxy-$env:APPVEYOR_REPO_TAG_NAME-win64" - ps: $env:BUILD_NAME="naiveproxy-$env:APPVEYOR_REPO_TAG_NAME-win-$env:PLATFORM"
- bash -c 'mkdir $BUILD_NAME' - bash -c 'mkdir $BUILD_NAME'
- bash -c 'cp src/out/Release/naive.exe src/config.json LICENSE USAGE.txt $BUILD_NAME' - bash -c 'cp src/out/Release/naive.exe src/config.json LICENSE USAGE.txt $BUILD_NAME'
- bash -c '7z a $BUILD_NAME.zip $BUILD_NAME' - bash -c '7z a $BUILD_NAME.zip $BUILD_NAME'

View file

@ -6,16 +6,16 @@ mkdir -p "$TMPDIR"
if [ "$1" = debug ]; then if [ "$1" = debug ]; then
out=out/Debug out=out/Debug
flags=' flags="$EXTRA_FLAGS
is_debug=true is_debug=true
is_component_build=true' is_component_build=true"
else else
out=out/Release out=out/Release
flags=' flags="$EXTRA_FLAGS
is_official_build=true is_official_build=true
use_jumbo_build=true use_jumbo_build=true
exclude_unwind_tables=true exclude_unwind_tables=true
symbol_level=0' symbol_level=0"
fi fi
if which ccache >/dev/null 2>&1; then if which ccache >/dev/null 2>&1; then

View file

@ -31,14 +31,9 @@ fi
# sccache (Windows) # sccache (Windows)
if [ "$ARCH" = Windows ]; then if [ "$ARCH" = Windows ]; then
export PATH="$PATH:$HOME/.cargo/bin" sccache_url="https://github.com/mozilla/sccache/releases/download/0.2.8/sccache-0.2.8-x86_64-pc-windows-msvc.tar.gz"
if ! which cargo >/dev/null 2>&1; then mkdir -p ~/.cargo/bin
curl -OJ https://win.rustup.rs/ curl -L "$sccache_url" | tar xzf - --strip=1 -C ~/.cargo/bin
./rustup-init.exe -y -v --no-modify-path
fi
if ! which sccache >/dev/null 2>&1; then
cargo install --git https://github.com/mozilla/sccache.git
fi
fi fi
# gn # gn