This version focuses on refactoring and optimizing the internal parallel construction mechanism, realizing the parallel compilation of source files between multiple targets and the support of parallel links. At the same time, it optimizes some internal losses of xmake and fixes some bugs affecting the compilation speed.
Through test and comparison, the current overall construction speed is basically the same as that of ninja. Compared with cmake / make, meson / Ninja are much faster, because they have an additional step in the process of generating makefile / build.ninja.
In addition, xmake also adds support for Sdcc compilation tool chain, which is used to compile embedded programs such as 51 / stm8.
- Project source code
- Official documents
Some optimization points
- All source files between multiple targets are built in parallel at the same time (previously, they cannot cross targets, and they will be blocked and serialized by links in the middle)
- Multiple independent target links can be executed in parallel (previously, only one link can be executed one by one)
- Fix the previous task scheduling bug, make more fine-grained scheduling, and make full use of CPU core resources
- The effect of optimizing some losses on xmake’s internal API is also obvious
For more optimization details, see issue #589
Construction speed comparison
We have done some comparative tests on termux and MacOS. The test project is xmake core
For a relatively large number of target projects, the new version of xmake has significantly improved its construction speed.
Multitask parallel compilation test
|Build system||Termux (8core/-j12)||Build system||MacOS (8core/-j12)|
Single task compilation test
|Build system||Termux (-j1)||Build system||MacOS (-j1)|
- Add PowerShell color theme for background color display under PowerShell terminal
- add to
xmake --dry-run -vCommand to run the build empty, just to view the detailed build commands
- #712: add Sdcc platform and support Sdcc compiler
- #589: improve and optimize the construction speed, support cross target parallel compilation and link, and the compilation speed is basically the same as that of ninja
- Improving Ninja / cmake project file generator plug-in
- #728: improved os.cp to support recursive replication at the source directory structure level
- #732: improved find_ Package supports finding packages installed by homebrew / cmake
- #695: improved using the latest ABI naming of Android NDK
- Fix link error display in Windows
- #718: fixed the problem of cache invalidation with a certain probability when dependent package downloads multiple images
- #722: fix installation deadlock caused by invalid package dependency
- #719: fixed the problem that the. Bat sub process failed to exit immediately after the main process received Ctrl C under windows
- #720: repair compile_ Path escape of commands generator