Location for cross platform source code

murray_lang
Posts: 24
Joined: Fri Oct 07, 2016 4:43 pm

Location for cross platform source code

Postby murray_lang » Fri Oct 07, 2016 5:20 pm

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.

ESP_Sprite
Posts: 9051
Joined: Thu Nov 26, 2015 4:08 am

Re: Location for cross platform source code

Postby ESP_Sprite » Sat Oct 08, 2016 1:24 am

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.

murray_lang
Posts: 24
Joined: Fri Oct 07, 2016 4:43 pm

Re: Location for cross platform source code

Postby murray_lang » Sun Oct 09, 2016 5:17 am

Thank you Master Sprite!

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

Cheers,
Murray

Who is online

Users browsing this forum: No registered users and 232 guests