document optimized builds and add helper script

This commit is contained in:
Damien Elmes 2020-12-07 11:50:03 +10:00
parent fcdc51aace
commit bce1f56dde
7 changed files with 43 additions and 3 deletions

View file

@ -59,6 +59,17 @@ dependencies. When the build is complete, Anki will automatically start.
To play audio, install mpv. At the time of writing, recording is To play audio, install mpv. At the time of writing, recording is
not yet supported, as currently pyaudio is not being installed. not yet supported, as currently pyaudio is not being installed.
## Optimized builds
The `./run` command will create a non-optimized build by default. This is faster
to compile, but will mean Anki will run considerably slower.
To run Anki in optimized mode, use:
```
./scripts/runopt
```
## More ## More
For info on running tests, building wheels and so on, please see [Development](./development.md). For info on running tests, building wheels and so on, please see [Development](./development.md).

View file

@ -53,6 +53,17 @@ dependencies. When the build is complete, Anki will automatically start.
To play audio, use Homebrew to install mpv. At the time of writing, recording is To play audio, use Homebrew to install mpv. At the time of writing, recording is
not yet supported, as currently pyaudio is not being installed. not yet supported, as currently pyaudio is not being installed.
## Optimized builds
The `./run` command will create a non-optimized build by default. This is faster
to compile, but will mean Anki will run considerably slower.
To run Anki in optimized mode, use:
```
./scripts/runopt
```
## More ## More
For info on running tests, building wheels and so on, please see [Development](./development.md). For info on running tests, building wheels and so on, please see [Development](./development.md).

View file

@ -85,6 +85,17 @@ To play audio, mpv.exe or mplayer.exe must be on the path. At the time
of writing, recording is not yet supported, as currently pyaudio is of writing, recording is not yet supported, as currently pyaudio is
not being installed. not being installed.
## Optimized builds
The `.\run` command will create a non-optimized build by default. This is faster
to compile, but will mean Anki will run considerably slower.
To run Anki in optimized mode, use:
```
.\scripts\runopt
```
## More ## More
For info on running tests, building wheels and so on, please see For info on running tests, building wheels and so on, please see

4
run
View file

@ -3,14 +3,14 @@
set -e set -e
run_linux() { run_linux() {
bazel run //qt:runanki -- $* bazel run $BUILDARGS //qt:runanki -- $*
} }
run_mac() { run_mac() {
# QtWebEngineProcess is unable to locate icudtl.dat from a symlinked tree, # QtWebEngineProcess is unable to locate icudtl.dat from a symlinked tree,
# so we need to copy the files into a working folder before running on a Mac. # so we need to copy the files into a working folder before running on a Mac.
workspace=$(dirname $0) workspace=$(dirname $0)
bazel build //qt:runanki && \ bazel build $BUILDARGS //qt:runanki && \
rsync -aiL --exclude=anki/external --exclude=__pycache__ --delete \ rsync -aiL --exclude=anki/external --exclude=__pycache__ --delete \
$workspace/bazel-bin/qt/runanki* $workspace/bazel-copy/ && \ $workspace/bazel-bin/qt/runanki* $workspace/bazel-copy/ && \
$workspace/bazel-copy/runanki $* $workspace/bazel-copy/runanki $*

View file

@ -1 +1 @@
call .\bazel.bat run //qt:runanki -k -- %* call .\bazel.bat run %BUILDARGS% //qt:runanki -k -- %*

5
scripts/runopt Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash
set -e
BUILDARGS="-c opt" $(dirname $0)/../run

2
scripts/runopt.bat Executable file
View file

@ -0,0 +1,2 @@
set BUILDARGS=-c opt
call .\run.bat %*