Build Instructions under Windows¶
Note
The instructions on this page apply only for building V3.0.0-dev and later versions of EdgeTX.
Table of Contents¶
- Toolchain setup
- Visual Studio
- ARM GNU Toolchain
- Folders for libraries of the project
- Build script
- NSIS Windows installer creator
- Python package manager uv
- Python virtual environment
- Qt development framework
- Building
- Fetch the EdgeTX project
- Target specific build script
Toolchain setup¶
Visual Studio¶
Download and start Visual Studio 2022 Community installer: https://visualstudio.microsoft.com/downloads/
To start the installer in English to more easily follow the selection below, open a command prompt or PowerShell window in the folder you downloaded it to, and add --locale en-US when starting the installer executable. In PowerShell, prefix the file name with .\, e.g. .\VisualStudioSetup.exe --locale en-US. Under Individual components tab, minimally select the following components:
Under Code tools:
Git for Windows
Under Compilers, build tools and runtimes:
C++ Clang Compiler for Windows (19.1.5)
C++ CMake tools for Windows
MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest) (is typically already selected by default)
Under SDKs, libraries, and frameworks:
Windows 11 SDK (10.0.26100.4654)
In the a dialog asking if you want to continue without workloads, you can accept just to Continue. You can skip making an account and logging in, if asked by the installer.
ARM GNU Toolchain¶
Download https://developer.arm.com/-/media/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-mingw-w64-x86_64-arm-none-eabi.exe
Install it to default location and select Add path to environment variable.
Folders for libraries of the project¶
Create a folder to hold the development environment and the project, e.g. C:\edgetx.
Create a subfolder C:\edgetx\build-tools.
Download https://github.com/libsdl-org/SDL/releases/download/release-2.32.8/SDL2-devel-2.32.8-VC.zip and unpack it to C:\edgetx\build-tools\SDL2.
The zip file contains a versioned top-level folder, SDL2-2.32.8. Move its contents up one level, so that the cmake, include and lib folders are directly inside C:\edgetx\build-tools\SDL2. Check that C:\edgetx\build-tools\SDL2\cmake\sdl2-config.cmake exists. If it doesn't, CMake reports SDL not found! and the build fails.
Build script¶
Create C:\edgetx\edgetx_build.cmd with following contents. This is a shared script that is called by the radio specific build scripts described in Target specific build script, so do not run it directly:
@echo off
if not defined BUILD_RADIO (
echo This script is not meant to be run directly.
echo Run a radio specific build script instead, e.g. build_tx16s.cmd.
pause
exit /b 1
)
time /t
set CC=clang.exe
set CXX=clang++.exe
set NSIS_EXE=c:\Program Files (x86)\NSIS\makensis.exe
set SDL2=%EDGETX_BUILD_TOOLS%\SDL2\cmake
set QT_DIR=%EDGETX_BUILD_TOOLS%\Qt\6.9.3\msvc2022_64
set PATHS="-DSDL2_DIR=%SDL2%"
set PREFIX_PATH="-DCMAKE_PREFIX_PATH=%QT_DIR%"
set LANGUAGE="-DTRANSLATIONS=%BUILD_LANGUAGE%"
echo ********************************************
echo Building radio: %BUILD_RADIO%
echo Language: %BUILD_LANGUAGE%
echo Debug build: %BUILD_DEBUG%
echo Firmware: %BUILD_FW%
echo Companion: %BUILD_CPN%
echo Installer: %BUILD_INSTALLER%
echo ********************************************
REM
REM prepare build
REM
cd %EDGETX_REPO%
if %BUILD_DEBUG%=="yes" (
set "BUILD_TYPE=-DDEBUG=YES -DCMAKE_BUILD_TYPE=Debug"
) else (
set "BUILD_TYPE=-DCMAKE_BUILD_TYPE=Release"
)
cd %EDGETX_MAIN_DIR%
set BUILD_FOLDER="build-output-%BUILD_RADIO%"
mkdir %BUILD_FOLDER%
cd %BUILD_FOLDER%
call "c:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat" -startdir=none -arch=x64 -host_arch=x64
call "%EDGETX_BUILD_TOOLS%\.venv\Scripts\activate.bat"
REM
REM start build
REM
cmake -G Ninja %BUILD_OPTIONS% %PATHS% %PREFIX_PATH% %LANGUAGE% %BUILD_TYPE% %EDGETX_REPO%
if %BUILD_FW%=="yes" (
ninja arm-none-eabi-configure
ninja -C arm-none-eabi firmware
)
REM If building installer is requested, need to build Companion
if %BUILD_INSTALLER%=="yes" GOTO build_cpn
if %BUILD_CPN%=="yes" GOTO build_cpn
REM else
GOTO exit_script
:build_cpn
ninja native-configure
ninja wasi-module
if not exist native\plugins mkdir native\plugins
copy /y wasm\wasm-build\*.wasm native\plugins\
ninja -C native simulator
ninja -C native companion
if %BUILD_INSTALLER%=="yes" (
ninja -C native install
%QT_DIR%\bin\windeployqt --libdir native\_install\bin --plugindir native\_install\plugins --no-compiler-runtime --no-translations --release native
robocopy %QT_DIR%\bin\ native\_install\bin qt.conf
"%NSIS_EXE%" native/companion/companion.nsi
)
REM The following is in order to be able to run companion and simulator binaries directly in build output folder
%QT_DIR%\bin\windeployqt --libdir native --plugindir native\plugins --no-compiler-runtime --no-translations --release native
copy %EDGETX_BUILD_TOOLS%\SDL2\lib\x64\SDL2.dll %EDGETX_MAIN_DIR%\%BUILD_FOLDER%\native\
copy /y wasm\wasm-build\*.wasm native\
REM
REM done
REM
:exit_script
call "%EDGETX_BUILD_TOOLS%\.venv\Scripts\deactivate.bat"
time /t
pause
NSIS Windows installer creator¶
Install the NSIS compiler from https://nsis.sourceforge.io/Download
Python package manager uv¶
Open a command prompt or PowerShell window and navigate to C:\edgetx\build-tools.
Install Python package manager uv according to the installation instructions at: https://docs.astral.sh/uv/getting-started/installation/#__tabbed_1_2
Python virtual environment¶
Continue at C:\edgetx\build-tools:
uv venv
uv pip install asciitree clang jinja2 lz4 pillow pydantic pyelftools typing_extensions aqtinstall
Qt development framework¶
Continue at C:\edgetx\build-tools to install Qt 6.9.3 into C:\edgetx\build-tools\Qt, using the aqt tool from the Python virtual environment:
mkdir Qt
cd Qt
uv run aqt install-qt windows desktop 6.9.3 win64_msvc2022_64 -m qtmultimedia qtserialport
uv run finds the virtual environment in the parent folder, so there is no need to activate it first. Close any open command prompt or PowerShell windows before continuing. New windows will pick up the PATH changes made by the ARM toolchain and uv installers.
Building¶
Fetch the EdgeTX project¶
Open a command prompt or PowerShell window at C:\edgetx and clone the EdgeTX repo:
main for the main development brach, or use a tag, if you wish to download a release version, such as v3.0.1. This will fetch the project into C:\edgetx\edgetx. Target specific build script¶
Create a radio specific build script, e.g. here for example for RadioMaster TX16s (create it e.g. as C:\edgetx\build_tx16s.cmd):
@echo off
set EDGETX_MAIN_DIR=C:\edgetx
set EDGETX_REPO=C:\edgetx\edgetx
set EDGETX_BUILD_TOOLS=C:\edgetx\build-tools
set BUILD_RADIO="TX16s"
set "BUILD_OPTIONS=-DPCB=X10 -DPCBREV=TX16S"
set BUILD_LANGUAGE="EN"
set BUILD_DEBUG="no"
set BUILD_FW="yes"
set BUILD_CPN="yes"
set BUILD_INSTALLER="yes"
call "%EDGETX_MAIN_DIR%\edgetx_build.cmd"
C:\edgetx\build_tx16s.cmd) in a command prompt or PowerShell window. It runs under the command prompt either way. After the build finishes, you can find the binaries under C:\edgetx\build-output-<BUILD_RADIO> (firmware binary under subfolder arm-none-eabi, Companion and Simulator binaries together with the WASM simulator module under folder native and Companion installer under subfolder native\companion).
Changing build options
Be sure to wipe the C:\edgetx\build-output-<BUILD_RADIO> content every time you change the build options.
See https://github.com/EdgeTX/edgetx/blob/main/tools/build-common.sh for BUILD_OPTIONS to use for various EdgeTX supported radios. Separate the options with spaces, exactly as in that script, and keep the quotes around the whole "BUILD_OPTIONS=..." assignment so that cmake receives each option as a separate argument.
Separate options with spaces, not semicolons
Do not separate the options with semicolons, e.g. set BUILD_OPTIONS="-DPCB=X10;-DPCBREV=TX16S". This older form of the script passes all options to cmake as a single value and the build fails with an error such as Unknown PCB 'X10 -DPCBREV=TX16S'. If you have an existing build script written this way, change it to the form shown above, and do the same for any other variable holding more than one -D option (e.g. PATHS or BUILD_TYPE), then wipe the build output folder.