Use xmake tool to compile the RT-Thread project
Thanks to the community developer Papalymo contributed to this tutorial.
In the latest RT-Thread master repository, there is support for compiling RT-Thread projects using the xmake tool.
Xmake is a cross-platform build utility based on Lua, if using xmake.lua to maintain project construction, compared to makefile/CMakeLists.txt, its configuration syntax is more concise and intuitive, very friendly to new users, can quickly get started, and will save a lot of time for the project development.
Open powershell manager, and enter the command:
1Invoke-Expression (Invoke-Webrequest 'https://xmake.io/psget.text' -UseBasicParsing).Content
Enter xmake — version, to check if xmake is successfully installed:
1PS C:\Users> xmake --version
2xmake v2.6.5+master.1c4b7d59a, A cross-platform build utility based on Lua
3Copyright (C) 2015-present Ruki Wang, tboox.org, xmake.io
5 __ ___ __ __ __ _| | ______
6 \ \/ / | \/ |/ _ | |/ / __ \
7 > < | \__/ | /_| | < ___/
8 /_/\_\_|_| |_|\__ \|_|\_\____|
9 by ruki, xmake.io
11 👉 Manual: https://xmake.io/#/getting_started
12 🙏 Donate: https://xmake.io/#/sponsor
Use xmake tool to compile the RT-Thread project.
Set toolchain path
Here we’re taking the gcc-arm-none-eabi-10.3 as an example:
Generate the project file
stm32f407-st-discovery project as an example, open the RT-Thread Env tool in the BSP directory, enter the command
scons --target=xmake to generate the xmake.lua file:
xmake -j 16to compile the project:
It is done!