We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eae344c commit c22e43dCopy full SHA for c22e43d
CMakeLists.txt
@@ -101,9 +101,12 @@ if (CMAKE_C_COMPILER_ID MATCHES "Clang")
101
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=return-type")
102
endif()
103
104
-if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
+if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
105
add_compile_options(-ffunction-sections -fdata-sections)
106
- add_link_options(-Wl,--dead_strip)
+ 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)
110
elseif (MSVC)
111
# MSVC equivalent for dead code stripping
112
add_link_options(/OPT:REF /OPT:ICF)
0 commit comments