Skip to content

Commit 6291af4

Browse files
davidbenCQ bot account: commit-bot@chromium.org
authored and
CQ bot account: [email protected]
committed
Add -DOPENSSL_SMALL to CMake.
Adding preprocessor flags requires a lot of typing in the CMake command-line (-DCMAKE_C_FLAGS=-DOPENSSL_SMALL -DCMAKE_CXX_FLAGS=-DOPENSSL_SMALL). Change-Id: Ieafc4155d656306c1f22746f780faa5c1d3e27be Reviewed-on: https://boringssl-review.googlesource.com/26784 Reviewed-by: Adam Langley <[email protected]> Commit-Queue: Adam Langley <[email protected]> CQ-Verified: CQ bot account: [email protected] <[email protected]>
1 parent 441efad commit 6291af4

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

BUILDING.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,14 @@ corresponding ARM feature.
150150
Note that if a feature is enabled in this way, but not actually supported at
151151
run-time, BoringSSL will likely crash.
152152

153-
# Running tests
153+
## Binary Size
154+
155+
The implementations of some algorithms require a trade-off between binary size
156+
and performance. For instance, BoringSSL's fastest P-256 implementation uses a
157+
148 KiB pre-computed table. To optimize instead for binary size, pass
158+
`-DOPENSSL_SMALL=1` to CMake or define the `OPENSSL_SMALL` preprocessor symbol.
159+
160+
# Running Tests
154161

155162
There are two sets of tests: the C/C++ tests and the blackbox tests. For former
156163
are built by Ninja and can be run from the top-level directory with `go run

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ if(FIPS)
279279
endif()
280280
endif()
281281

282+
if(OPENSSL_SMALL)
283+
add_definitions(-DOPENSSL_SMALL)
284+
endif()
285+
282286
# CMake's iOS support uses Apple's multiple-architecture toolchain. It takes an
283287
# architecture list from CMAKE_OSX_ARCHITECTURES, leaves CMAKE_SYSTEM_PROCESSOR
284288
# alone, and expects all architecture-specific logic to be conditioned within

0 commit comments

Comments
 (0)