I use lazbuild to compile my app for multiple platforms. To speed up the process, I want to invoke several instances of lazbuild in parallel. On any modern multi-core machine, this dramatically decreases build time. For example, if building for one platform takes 30 seconds, building for four platforms sequentially takes 2 minutes. However, running four instances of lazbuild on multiple cores compiles everything in 35 seconds.
The issue is concurrency. In my LPI file, I have something like this:
<UnitOutputDirectory Value="$(TestDir)\lib\$(TargetCPU)-$(TargetOS)" />
This ensures all PPUs and related files go to a separate directory for each platform and don't conflict with each other during parallel builds. However, the problem is that lazbuild recompiles the project resources and updates the RES file in the project folder. This leads to concurrency issues as multiple processes try to update the same file, resulting in failed builds or broken project resources.
Is there a way to rebuild project resources to UnitOutputDirectory or a similar location, so multiple instances of lazbuild do not conflict with each other? Perhaps this could be a lazbuild improvement.