Skip to content

Commit 7ed7479

Browse files
lucylqfacebook-github-bot
authored andcommitted
Add buck config to remove ET_LOG (#569)
Summary: Pull Request resolved: #569 |**build, stripped** | **x86_64 (devserver)** | **arm64 (macbook)** | |With ET_LOG, verification | 82576 | 122376 | |Without ET_LOG | 67576 | 105720 | |Without ET_LOG, verification | 48584 | 89280| Reviewed By: larryliu0820 Differential Revision: D49709986 fbshipit-source-id: d68c101738eb6395b30c5741c879d94a435684ec
1 parent fdaf6fa commit 7ed7479

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

runtime/platform/targets.bzl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ def define_common_targets():
5757
force_static = True,
5858
)
5959

60+
# Enable or disable ET_LOGs
61+
enable_et_log = native.read_config("executorch", "enable_et_log", None)
62+
6063
# Interfaces for executorch users
6164
runtime.cxx_library(
6265
name = "platform",
@@ -73,7 +76,7 @@ def define_common_targets():
7376
"profiler.cpp",
7477
"runtime.cpp",
7578
],
76-
exported_preprocessor_flags = get_profiling_flags(),
79+
exported_preprocessor_flags = get_profiling_flags() + (["-DET_LOG_ENABLED=0"] if enable_et_log else []),
7780
exported_deps = [
7881
"//executorch/runtime/platform:pal_interface",
7982
":compiler",

test/targets.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def define_common_targets():
2424
#
2525
# It's also best to build this with `-c executorch.enable_program_verification=false`
2626
# to remove ~30kB of optional flatbuffer verification code from the binary.
27+
# Building with `-c executorch.enable_et_log=0` removes ~15kB from the binary.
2728
runtime.cxx_binary(
2829
name = "size_test",
2930
srcs = SIZE_TEST_SOURCES,

0 commit comments

Comments
 (0)