Skip to content

Commit 9e49741

Browse files
committed
On Android platforms, removing the lto and no-plt configurations, which together with the 16k page size configuration, will significantly increase the size of the SO file.
1 parent b9472e2 commit 9e49741

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,11 @@ else ()
360360
# xcode 14.0.1 must manually set -std=c++14 since set(CMAKE_CXX_STANDARD 14) has no effect when compiler iOS-Simulator on M1
361361
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMM_FLAGS_} -std=c++14")
362362

363-
# enable lto and no-plt
364-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto -fno-plt")
365-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto -fno-plt")
363+
# enable lto and no-plt (only for non-Android platforms)
364+
if (NOT ANDROID)
365+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto -fno-plt")
366+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto -fno-plt")
367+
endif()
366368

367369
if (LINUX)
368370
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -pthread")

0 commit comments

Comments
 (0)