-
-
Notifications
You must be signed in to change notification settings - Fork 388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add flag to print the sketch compiler command #557
Comments
But do you then need just the command to compile the sketch? There are different commands for .c, .cpp, .S files, and a command for linking the entire sketch, all of which are printed for each file where appropriate already. Are you suggesting to only print all these, or just the sketch command? |
Another approach that might be related is to generate a "Compilation database" with all compiler commands that have been run. This seems to be a somewhat standardized file format, see arduino/arduino-builder#272 |
The command that is relevant for providing language support to the sketch file is the one that compiles the sketch source. But yes, at some point it might be interesting to have the information for other files, too. So generating a JSON file as specified by the LLVM project would be a viable alternative, and would be even more flexible. |
Closing because we implemented the compilation database functionality |
Feature Request
In order to support language servers for Arduino sketches, it is necessary to know the exact compiler command used by the CLI to compile a sketch. For example, the output of compiling the "KeyboardAndMouseControl" example is
What I'd like is a flag like
arduino-cli compile --show-compiler-command
that prints only the last line of the output above, but does not execute anything. That line contains/Users/spoenemann/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++
-c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD -mcpu=cortex-m3 -mthumb
Calling the actual compiler with the flag
-v
printsHere we can find the built-in configuration of the compiler, like default flags.
All this information is essential for providing correct language support in an IDE.
The text was updated successfully, but these errors were encountered: