espressif / idf-extra-components

Additional components for ESP-IDF, maintained by Espressif
143 stars 86 forks source link

fix(catch2): work around ranlib warning when building on macOS #271

Closed igrr closed 8 months ago

igrr commented 9 months ago

This PR fixes a warning issued when catch2 component was used with IDF_TARGET=linux on a macOS host.

macOS version of ranlib issues a warning when it encounters a static library with no extern symbols. When building catch2 component with IDF_TARGET=linux, the only object file in the library (cmd_catch2.cpp.obj) would indeed define no symbols, so libespressif__catch2.a would define no symbols as well, resulting in this warning.

Fix this by defining a dummy register_catch2 function even when building for IDF_TARGET=linux.