Skip to content

Commit

Permalink
add --gc-sections
Browse files Browse the repository at this point in the history
  • Loading branch information
microcai committed Jan 8, 2025
1 parent 77b7ffb commit 9055bf9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
option(WITHOUT_IOURING "use epoll/poll/kqueue to support IOCP. not io_uring" OFF)

if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-ffunction-sections)
add_compile_options(-ffunction-sections -fdata-sections)
add_link_options(-Wl,--gc-sections)
endif()

if (NOT WIN32)
Expand Down

0 comments on commit 9055bf9

Please sign in to comment.