Page 1 of 1

Location for cross platform source code

Posted: Fri Oct 07, 2016 5:20 pm
by murray_lang
Hi all,

I have written firmware that runs on a number of platforms, and much of the source code is common to all platforms. Now I want to port my code to the ESP32.

According to build_system.rst, I can list source directories in the SRCDIRS variable, but these directories are assumed to be under the project directory. Is this limitation real? Obviously it is not appropriate to put sources common to multiple platforms into the project directory of one of the platforms.

Can I get the ESP32 build system to compile sources that are outside of the tree of the project being built?

Thanks in advance.

Re: Location for cross platform source code

Posted: Sat Oct 08, 2016 1:24 am
by ESP_Sprite
Yes, you should be able to do this. Point the environment variable EXTRA_COMPONENT_DIRS to a directory containing your out-of-tree components and they should be included in the project as if they were located in the components/ subdirectory of your project.

Ah, that does assume the out-of-tree stuff is formatted like a component. Not sure if that is a dealbreaker to you. If not, you probably can get away making an empty component and using the SRC_DIR to point to an out-of-tree source directory. While untested, I think this should work; if not, feel free to create an issue on Github.

Re: Location for cross platform source code

Posted: Sun Oct 09, 2016 5:17 am
by murray_lang
Thank you Master Sprite!

I will give these a try. (Gotta do what you gotta do.)

Cheers,
Murray