I put this lines in platform.ini
But there are still source lines in firmware.bin
the line to compile is:
xtensa-esp32-elf-g++ -o .pio\build\esp32cam\src\app_httpd.cpp.o -c -fno-rtti -fno-exceptions -std=gnu++11 -mfix-esp32-psram-cache-issue -O3 -Wall -nostdlib -Wpointer-arith -Wno-error=unused-but-set-variable -Wno-error=unused-variable -mlongcalls -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -Wno-error=deprecated-declarations -Wno-error=unused-function -Wno-unused-parameter -Wno-sign-compare -fstack-protector -fexceptions -Werror=reorder -DPLATFORMIO=60111 -DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -DNDEBUG -DCORE_DEBUG_LEVEL=0 -DESP32 -DESP_PLATFORM -DF_CPU=240000000L -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DARDUINO=10805 -DARDUINO_ARCH_ESP32
That’s not “source code”. Those are text strings that the firmware uses for HTTP handling and logging. A lot of it seems to be coming from the camera module or code, your code was maybe inspired by this. If you don’t want these (optional) strings to show up, you’ll have to find where they are in code and comment them out, or put them in a
#ifndef NDEBUG
Serial.println(...);
#endif
block, or convert them to ESP_LOGE, ESP_LOGI, etc, like show here, so that they are optimized away through the CORE_DEBUG_LEVEL=0 setting (this disables all ESP_LOGx functions).
Of course, some strings will be mandatory. You can’t really e.g. optimze away the HTTP header strings your program is using in its HTTP transmissions.