How to Automatically Pre-Compile Library Archives

This functionality was added in release 2021.0917.6.

Some Arduino Libraries come with pre-compiled architecture specific Archive files, which greatly speed up compilation.

You can now create these with a simple option change in Visual Micro, for any Arduino Library.

Enabling Auto Archive Compilation

Add your Library as a Shared Project, or a Cloned Library so it is available within Solution Explorer as shown below (see Library addition option selection here).

Solution Explorer with Cloned / Shared Project Library Added

Right click the Library project in Solution Explorer

Change the option for Auto Pre-Compile to True.

Library Properties for Auto Pre-Compile

Build your project as normal, the Archive file will be compiled and added to your library, along with updating the library.properties file.

Auto Pre-Compile Build Output First Compile

Next time you build your project it will now use the pre-compiled header created above.

Auto Pre-Compile Build Output Subsequent Compile

 

Note Icon Note:

If you change your library code, or select a different board architecture, you will need to turn the Auto Pre-Compile option to False, then True, and rebuild the project to create the new Archive.

 

Troubleshooting

If there is an error updating the library folder the below error will be displayed:

Auto Pre-Compile Build Output with Access Error