Skip to content

Commit

Permalink
Added option to disable gc-sections flag
Browse files Browse the repository at this point in the history
  • Loading branch information
mshabunin committed Dec 7, 2017
1 parent 6fb9d42 commit 38c62f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmake/OpenCVCompilerOptions.cmake
Expand Up @@ -184,8 +184,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
# Remove unreferenced functions: function level linking
add_extra_compiler_option(-ffunction-sections)
add_extra_compiler_option(-fdata-sections)
if(NOT APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
if(NOT APPLE AND NOT OPENCV_SKIP_GC_SECTIONS)
set(OPENCV_EXTRA_EXE_LINKER_FLAGS "${OPENCV_EXTRA_EXE_LINKER_FLAGS} -Wl,--gc-sections")
endif()
endif()

Expand Down

0 comments on commit 38c62f6

Please sign in to comment.