claws / BH1750

An Arduino library for the digital light sensor breakout boards containing the BH1750FVI IC
MIT License
248 stars 107 forks source link

Add component.mk for use with esp-idf #48

Closed wridgers closed 6 years ago

wridgers commented 6 years ago

Useful when writing code for ESP32.

claws commented 6 years ago

Thanks for the contribution. I have a query.

Reading through the docs for the ESP Build System I see that:

Your merge request delivers a component.mk file that defines two override variables, COMPONENT_SRCDIRS and COMPONENT_ADD_INCLUDEDIRS.

After reading the documentation I conclude that the component.mk only needs to have one entry which provides an override for COMPONENT_ADD_INCLUDEDIRS so that the .h file can be found in the current directory, not in the default include directory location.

I do not think the component.mk needs to explicitly specify the COMPONENT_SRCDIRS as its default setting is the current directory, as indicated by the docs snippet below:

COMPONENT_SRCDIRS: Directory paths, must be relative to the component directory, which will be searched for source files (*.cpp, *.c, *.S). Defaults to ‘.’, ie the component directory itself. Override this to specify a different list of directories which contain source files.

Can you investigate whether COMPONENT_SRCDIRS is really needed by removing it from your component.mk file and trying the component build again?

If COMPONENT_SRCDIRS is not required can you update the merge request to remove the redundant line?

wridgers commented 6 years ago

Hi @claws, you're absolutely right - thanks for spotting this.

I can confirm that my project builds with the newer component.mk file, and that it does not build if the file is empty.