Hi - I'm not sure if your proposed demonstration leads me to what I need to show. Please let's do it my way:
- Open a copy of the Blinker example (see screenshot)
- Rebuild
- Open hardware\esp8266com\esp8266\libraries\Ticker\src\Ticker.cpp
- Just build, locate in the verbose log, just to be sure:
Using library Ticker version 1.0 in folder cker"
Using previously compiled file: er\Ticker.cpp.o
Using previously compiled library archive: er\Ticker.a
- Introduce any syntax error into Ticker.cpp, build, log file contains now:
Using library Ticker version 1.0 in folder cker"
lf/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ clude" nsa-lx106-elf/include" ore" -c -Wall -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++11 -MMD -ffunction-sections -fdata-sections -fno-exceptions -DNONOSDK22y=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10807 -DARDUINO_ESP8266_WEMOS_D1MINI -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD=\"ESP8266_WEMOS_D1MINI\" -DFLASHMODE_DIO -DESP8266 -I"D:\Users\dok\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266" -I"D:\Users\dok\Documents\Arduino\hardware\esp8266com\esp8266\variants\d1_mini" rc" duler\src" \Ticker.cpp" -o ker\Ticker.cpp.o"
Ticker.cpp: 35:2: error: found ':' in nested-name-specifier, expected
_timer(nullptr)
Ticker.cpp: 35:10: error: expected constructor, destructor, or type conversion before '(' token
_timer(nullptr)
Using previously compiled library archive: er\Ticker.a
- note file date of the Ticker.a archive file (15:08). That's from the original, successful compile... but there's more...
- Revert the previously introduced syntax error, if you feel like it, put in some change that will compile (something that triggers a compiler warning, maybe?). Build. Observe log, verify file date of the Ticker.a file (15:08):
Using library Ticker version 1.0 in folder cker"
lf/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ clude" nsa-lx106-elf/include" ore" -c -Wall -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++11 -MMD -ffunction-sections -fdata-sections -fno-exceptions -DNONOSDK22y=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10807 -DARDUINO_ESP8266_WEMOS_D1MINI -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD=\"ESP8266_WEMOS_D1MINI\" -DFLASHMODE_DIO -DESP8266 -I"D:\Users\dok\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266" -I"D:\Users\dok\Documents\Arduino\hardware\esp8266com\esp8266\variants\d1_mini" rc" duler\src" \Ticker.cpp" -o ker\Ticker.cpp.o"
Ticker.cpp: In constructor Ticker::Ticker()
Ticker.cpp: 38:8: warning: unused variable 'f' [-Wunused-variable]
float f = x \ 3.14
Using previously compiled library archive: er\Ticker.a
Attachment 2 is a screenshot that shows how the build code obviously didn't recreate the archive file.
Yes, I'm hacking intrinsic libraries, does this make all the difference? No, using
dot_a_linkage
in my own library in <sketchbook>/libraries, the same behavior, once there is an .a archive, it's never updated again.