-
Notifications
You must be signed in to change notification settings - Fork 12
Suport for ESP32 using Arduino libs #74
base: master
Are you sure you want to change the base?
Conversation
…hey will safely be ignored by the compiler since they don't end in .c or .cpp. Added library include directories for CLion compatibility.
Respect CMake include path when searching for library dependency directories
Now it supports any number of subsettings, and also single setting values like `name=Arduino` Additionally this adds a method which allows to replace variables within a settings value. E.g. `tools.avrdude.path={runtime.tools.avrdude.path}`
…H/hardware This also adds support for 3-rd party hardware definitions like espressif/esp32 Note that this does not yet add support for compiling esp32
@Pro First of all, welcome to the Arduino CMake organization - Glad to have you on board 😉 I've read parts of the changes you've introduced, but before going any further, I'd like you to read the Contribution Guidelines which drive our development. We won't accept any PRs that don't step up to the guideline's requirements. And last, we currently acknowledge the issue of not supporting other platforms than avr, and you can see the full discussion about it in #34. So frankly I don't know if your effort will worth it at the end, since you have to align to our guidelines, refactored codebase, and to provide a good enough solution that will generalize support for custom platform/boards and not just provide support for a specific one. Thanks again and good luck! |
Unfortunately I saw your repository too late and I based my changes on another fork (https://github.com/francoiscampbell/arduino-cmake) that's why there are so many conflicts. With my changes it is possible to easily add other platforms in a generalized way. What I am doing is to read the So all the configurations under I tested this with some arduino boards and it worked fine. Then I ran some tests with the Espressif ESP32 and that also works like a charm. Unfortunately I do not have the time to redo my changes for your much nicer fork, but feel free to reuse any changes from my PR for further improvements of any kind. You can close this PR if you do not think there is anybody who can transform this to your new format, or leave it open as a reminder for some later TODO item. For now I will stick to my fork and will use it for further development (with SDK 1.8.5). |
Well you pretty much bought me saying that you've added support for parsing the On another subject - I honestly think that this fork is the most stable one, sure as hell the most advanced and up-to-date, so it would be kind of a "waste" to continue developing your fork based on francoiscampbell's fork instead of ours. But that's completely your decision 😃 |
I hope that I can work with that version for now, so that I don't need to work on my fork that much, I woul definitely prefer to use your version! Anyways, if you need some starting points, integrating the parsing of the files in your version should not be that much of work, if you know your code. Some hints here:
That's it for parsing the file. Since within the file, each variable may reference another variable, you also need a method which does that replacement based on the current board setting. The replacement method is this one, it takes a string which contains variables, and it recursively replaces all other variables: To this method you can pass a variable name, and it will give you the filled value (using the previous replace method): To split the recipe (e.g. for compiling C files) this method is used: An example usage is shown here: get_recipe_flags(ARDUINO_COMPILE_CMD ARDUINO_COMPILE_FLAGS ${BOARD_ID} "recipe.cpp.o")
set_target_properties(${CORE_LIB_NAME} PROPERTIES
COMPILE_FLAGS "${ARDUINO_COMPILE_FLAGS}"
LINK_FLAGS "${ARDUINO_LINK_FLAGS}") Just search for other usages of the method The major work was to get the parsing and replacement correct, so that method you can simply copy/paste. Therefore there is not much work to do anymore. So IMHO if you find a few hours, you can integrate this into your nice work and I'm happy to assist you, if you have questions. |
I for one would also like to vote up the ESP support. It sounds like this is a huge PR (2000+ lines), but it also seems like the possible future merge would produce the absolute best of both worlds — a clean cmake toolchain plus support for custom platform.txt and ESP in particular. I want to mention also the I am the author of a ruby-based CLI tool arli which was built to manage Arduino Library dependencies using a YAML file describing projects dependencies. The tool can also generate a fresh new project and uses the older version of Arduino-Cmake project as the base. I would love to switch to the NG version asap, but as I understand this toolchain is a lot smarter about finding the libraries. But does it install them from the internet? Or do libraries need to be installed separately? Thanks for taking up this monumental project guys! It’s much appreciated by those of us who can’t stand to code inside a Java based text editor that takes five minutes to boot. I’m of course talking about the Arduino IDE. 😉 |
This PR is a follow-up of francoiscampbell#7 and adds support for compiling programs for an Espressif ESP32 chip.
In my tests I used an Adafruit Feather ESP32. It also adds an example for using the Access Point on ESP32