Skip to content

Commit 71ee890

Browse files
authored
尝试优化体积大小
1 parent 03c3078 commit 71ee890

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ enable_language(C CXX ASM)
66
set(CMAKE_CXX_STANDARD 20)
77
set(CMAKE_C_STANDARD 11)
88

9-
set(C_FLAGS "-Wall -Wextra -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -flto=thin")
10-
set(LINKER_FLAGS "-fuse-ld=lld -flto=thin -ffixed-x18 -Wl,--hash-style=both -Wl,--unresolved-symbols=ignore-all")
9+
set(C_FLAGS "-Wall -Wextra -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -flto=thin -ffunction-sections -fdata-sections")
10+
set(LINKER_FLAGS "-fuse-ld=lld -flto=thin -ffixed-x18 -Wl,--hash-style=both -Wl,--unresolved-symbols=ignore-all -Wl,--gc-sections")
1111

1212
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -fvisibility=hidden")
1313
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -fvisibility=hidden")
@@ -206,4 +206,4 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
206206

207207
target_link_libraries(${PROJECT_NAME} base procinfo lzma dexfile_support unwindstack log)
208208

209-
endif ()
209+
endif ()

0 commit comments

Comments
 (0)