diff --git a/docs/linux.md b/docs/linux.md index 1138d553b..c5fb99c7a 100644 --- a/docs/linux.md +++ b/docs/linux.md @@ -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 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 For info on running tests, building wheels and so on, please see [Development](./development.md). diff --git a/docs/mac.md b/docs/mac.md index 5bffb527f..6ce67d967 100644 --- a/docs/mac.md +++ b/docs/mac.md @@ -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 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 For info on running tests, building wheels and so on, please see [Development](./development.md). diff --git a/docs/windows.md b/docs/windows.md index df661f59c..829749300 100644 --- a/docs/windows.md +++ b/docs/windows.md @@ -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 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 For info on running tests, building wheels and so on, please see diff --git a/run b/run index 8d06b353a..69c9140ae 100755 --- a/run +++ b/run @@ -3,14 +3,14 @@ set -e run_linux() { - bazel run //qt:runanki -- $* + bazel run $BUILDARGS //qt:runanki -- $* } run_mac() { # 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. workspace=$(dirname $0) - bazel build //qt:runanki && \ + bazel build $BUILDARGS //qt:runanki && \ rsync -aiL --exclude=anki/external --exclude=__pycache__ --delete \ $workspace/bazel-bin/qt/runanki* $workspace/bazel-copy/ && \ $workspace/bazel-copy/runanki $* diff --git a/run.bat b/run.bat index d314ddbac..26977a2b0 100755 --- a/run.bat +++ b/run.bat @@ -1 +1 @@ -call .\bazel.bat run //qt:runanki -k -- %* +call .\bazel.bat run %BUILDARGS% //qt:runanki -k -- %* diff --git a/scripts/runopt b/scripts/runopt new file mode 100755 index 000000000..c8dbe22bd --- /dev/null +++ b/scripts/runopt @@ -0,0 +1,5 @@ +#!/bin/bash + +set -e + +BUILDARGS="-c opt" $(dirname $0)/../run diff --git a/scripts/runopt.bat b/scripts/runopt.bat new file mode 100755 index 000000000..9027d87d7 --- /dev/null +++ b/scripts/runopt.bat @@ -0,0 +1,2 @@ +set BUILDARGS=-c opt +call .\run.bat %*