Skip to content

Commit 3ba9707

Browse files
pgorszkowski-igaliamagomez
authored andcommitted
OptionWPE: Optimize binary size of debug build
This fix helps to build debug version of WPE for 32-bit RPi. Unfortunately the build can be done only with at least -O1 (for 32-bit RPi).
1 parent a5cc1c4 commit 3ba9707

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Source/cmake/OptionsWPE.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,4 +482,7 @@ if (COMPILER_IS_GCC_OR_CLANG AND UNIX AND NOT APPLE)
482482
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${CMAKE_COMPILER_SIZE_OPT_FLAGS} -ffunction-sections -fdata-sections")
483483
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${CMAKE_COMPILER_SIZE_OPT_FLAGS} -ffunction-sections -fdata-sections -fno-rtti")
484484
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -Wl,--gc-sections")
485+
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}${CMAKE_COMPILER_SIZE_OPT_FLAGS} -ffunction-sections -fdata-sections")
486+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${CMAKE_COMPILER_SIZE_OPT_FLAGS} -ffunction-sections -fdata-sections -fno-rtti")
487+
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -Wl,--gc-sections")
485488
endif ()

0 commit comments

Comments
 (0)