Skip to content

Commit c0c3a1b

Browse files
authored
Enabled LTO on android (#52)
1 parent 29aad7a commit c0c3a1b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

android/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
cmake_minimum_required(VERSION 3.6.0)
16+
project("webcrypto" LANGUAGES C)
1617

1718
enable_language(ASM)
1819

@@ -35,6 +36,10 @@ include(
3536
# https://boringssl.googlesource.com/boringssl/+/HEAD/BUILDING.md#binary-size
3637
add_definitions(-DOPENSSL_SMALL)
3738

39+
# Enable link time optimization
40+
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -flto")
41+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto")
42+
3843
# Android ABIs, see also:
3944
# https://developer.android.com/ndk/guides/abis
4045
if(ANDROID_ABI STREQUAL "armeabi-v7a")

0 commit comments

Comments
 (0)