Skip to content

Commit 38c62f6

Browse files
committed
Added option to disable gc-sections flag
1 parent 6fb9d42 commit 38c62f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmake/OpenCVCompilerOptions.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
184184
# Remove unreferenced functions: function level linking
185185
add_extra_compiler_option(-ffunction-sections)
186186
add_extra_compiler_option(-fdata-sections)
187-
if(NOT APPLE)
188-
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
187+
if(NOT APPLE AND NOT OPENCV_SKIP_GC_SECTIONS)
188+
set(OPENCV_EXTRA_EXE_LINKER_FLAGS "${OPENCV_EXTRA_EXE_LINKER_FLAGS} -Wl,--gc-sections")
189189
endif()
190190
endif()
191191

0 commit comments

Comments
 (0)