Skip to content

Commit

Permalink
设置编译链接参数
Browse files Browse the repository at this point in the history
  • Loading branch information
chase535 authored Jan 1, 2023
1 parent 72b181a commit 13c94ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ project(accurate_battery)
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "aarch64")


# 设置编译链接参数
set(CMAKE_C_FLAGS "-O3 -fvisibility=hidden -flto -Wall -Werror -fdata-sections -ffunction-sections -fno-omit-frame-pointer -D_GNU_SOURCE")
set(CMAKE_EXE_LINKER_FLAGS "-static -O3 -fvisibility=hidden -flto -Wl,-O3,--strip-all -ffixed-x18 -Wl,--hash-style=both -fPIE -Wl,-exclude-libs,ALL -Wl,--gc-sections")

# 指定生成目标
file(GLOB_RECURSE ALL_SRCS "accurate_battery*.c")
Expand Down

0 comments on commit 13c94ce

Please sign in to comment.