Guidelines to modify arduino build process to support static linking of code.

Hello Everyone , I am trying to compile a code with uses a static library code (.lib) file with a c header file (.h). I want to edit build process of arduino ide to support my compilation. I need to ask what are the methods to edit arduino build files to support such kind of thing.

I need to ask what are the methods to edit arduino build files to support such kind of thing.

The Arduino IDE doesn't support such a build system.

I am trying to compile a code with uses a static library code (.lib) file with a c header file (.h). I want to edit build process of arduino ide to support my compilation.

Static library code in a .lib file? For which processor platform was that library compiled? That sounds like a windows library to me but no Arduino board can execute Windows binary code.

The Arduino eco system depends on open sourcing everything, even the hardware (at least above the chip level). Concepts like distributing procompiled (static) libraries is diametrically against the Arduino principles. So I doubt that you'll find anyone willing to extend the Arduino IDE to support such a concept.

I don’t know anything about this .lib, but precompiled libraries are supported.

As you guessed, this was a controversial topic and this capability was explicitely prohibited for some years. However, it came to light that there are very legitimate uses for this capability other than “thems can’ts haveses my precious codeses”:

  • Precompiling huge open source libraries so their initial compile doesn’t take forever. This is becoming increasingly relevant as the support for more resource rich microcontrollers allows very complex applications such as machine learning.
  • In some cases, the only option is the precompiled binaries provided by a component manufacturer. This can be wrapped in an open source library that extends and makes more user friendly the API of the binary.

You can find the full documentation of this feature at the “precompiled” bullet point under this section the Arduino Library Specification:
https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format