Export ET_LOG_ENABLED=0 as PUBLIC compile definition on cmake targets#17907
Export ET_LOG_ENABLED=0 as PUBLIC compile definition on cmake targets#17907
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17907
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 125 PendingAs of commit 6b49d95 with merge base 1143673 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR needs a
|
The executorch and executorch_core cmake targets did not propagate
ET_LOG_ENABLED=0 to consumers via INTERFACE_COMPILE_DEFINITIONS.
This caused inline/template functions from headers (e.g.
MemoryAllocator::allocate, Result::CheckOk) to be instantiated
with logging enabled in consumer TUs, pulling in format strings,
et_pal_emit_log_message, and the full POSIX logging stack (fprintf,
chrono).
Adding ET_LOG_ENABLED=0 as a PUBLIC definition ensures consumers
compile header code with the same logging state as the library.
Reduces stripped size_test by 4,096 bytes and stripped
size_test_all_ops by 8,192 bytes.