Skip to content

Commit

Permalink
added LTO in cmakelists
Browse files Browse the repository at this point in the history
  • Loading branch information
itzandroidtab committed Mar 24, 2024
1 parent b76500a commit 4caac57
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ add_executable(klib_project
${SOURCES} ${HEADERS}
)

# enable LTO
target_compile_options(klib PUBLIC "-flto")
target_compile_options(klib PUBLIC "-fuse-linker-plugin")
target_link_options(klib PUBLIC "-flto")
target_link_options(klib PUBLIC "-fuse-linker-plugin")

# set the output filename
set_target_properties(klib_project PROPERTIES OUTPUT_NAME "klib" SUFFIX ".elf")

Expand Down

0 comments on commit 4caac57

Please sign in to comment.