Skip to content

Commit c22e43d

Browse files
committed
Linux fix
1 parent eae344c commit c22e43d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,12 @@ if (CMAKE_C_COMPILER_ID MATCHES "Clang")
101101
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=return-type")
102102
endif()
103103

104-
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
104+
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
105105
add_compile_options(-ffunction-sections -fdata-sections)
106-
add_link_options(-Wl,--dead_strip)
106+
add_link_options(-Wl,-dead_strip)
107+
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
108+
add_compile_options(-ffunction-sections -fdata-sections)
109+
add_link_options(-Wl,--gc-sections)
107110
elseif (MSVC)
108111
# MSVC equivalent for dead code stripping
109112
add_link_options(/OPT:REF /OPT:ICF)

0 commit comments

Comments
 (0)