sparkfun / Arduino_Apollo3

Arduino core to support the Apollo3 microcontroller from Ambiq Micro
83 stars 37 forks source link

provide some files / tools / tutorials to be able to use clangd and / or other tooling #364

Closed jerabaul29 closed 3 years ago

jerabaul29 commented 3 years ago

As hinted in some previous issues, one thing that frustrates me when working with this core so far is the lack of good developer tooling. I spend a lot of time looking for missing ; , badly spelled variables, and many other minor issues that are very time consuming to find and fix manually, but would be caught by a linter / static analyzer in the blink of an eye.

It looks like there is no platformio support yet. Then I will need to set up things myself on my machine for my editor, probably with some form of clangd: https://clangd.llvm.org/installation.html .

But the thing is, to set up the clangd and get it working, I need to be able to configure it. The simplest way to do so is to use some CMake commands, from the same page:

If your project builds with CMake, it can generate this file. You should enable it with:

cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1

compile_commands.json will be written to your build directory. You should symlink it (or simply copy it) to the root of your source tree, if they are different.

ln -s ~/myproject/compile_commands.json ~/myproject-build/

Any guidance on how to perform such a config? Where is the CMake file available (and is it well CMake, or is something else used for building?), could you provide a bit of support helping to set up tooling?

If you suggest another way to develop with good tooling fine to me, but in this case, can you make it clear what / how to use tooling?

Wenn0101 commented 3 years ago

Closing out stale issues. If you still need help please open a new issue, this looks like it could also make a good discussion thread.