Skip to content

Commit 620b769

Browse files
lucylqfacebook-github-bot
authored andcommitted
Remove ET_LOG and verification from OSS Release build (#509)
Summary: Pull Request resolved: #509 Removing ET_LOG and verification from OSS Release build. |**build, stripped** | **x86_64 (devserver)** | **arm64 (macbook)** | | With ET_LOG, verification | 72232 | 89544 | | Without ET_LOG | 51728 | 72712 | | Without ET_LOG, verification | 39440 | 56072| Reviewed By: dbort Differential Revision: D49708709 fbshipit-source-id: 817d98d4b96bbd0dbb14eea1f0e759a3dff2a966
1 parent 8accb86 commit 620b769

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,19 @@ endif()
5353
if(NOT CMAKE_BUILD_TYPE)
5454
set(CMAKE_BUILD_TYPE Debug)
5555
endif()
56+
57+
# https://cmake.org/cmake/help/latest/command/add_definitions.html
58+
# Adds definitions to the compiler command line for
59+
# - targets in the current directory, before and after this command is invoked
60+
# - targets in sub-directories added after this command is invoked
61+
if(CMAKE_BUILD_TYPE STREQUAL "Release")
62+
# Avoid pulling in the logging strings, which can be large.
63+
add_definitions(-DET_LOG_ENABLED=0)
64+
# Avoid pulling in the flatbuffer data verification
65+
# logic, which can add about 20kB.
66+
add_definitions(-DET_ENABLE_PROGRAM_VERIFICATION=0)
67+
endif()
68+
5669
# -Os: Optimize for size. -ffunction-sections -fdata-sections: breaks function
5770
# and data into sections so they can be properly gc'd. -s: strip symbols
5871
set(CMAKE_CXX_FLAGS_RELEASE

0 commit comments

Comments
 (0)