package/pkg-cmake: use MinSizeRel for size optimized build
PATCH 1/1 package/pkg-cmake: use MinSizeRel for size optimized build
MinSizeRel sets the gcc compiler optimization level to '-Os' whereas Release sets it to '-O3'.
Signed-off-by J?rg Krause <[email protected]>
--- package/pkg-cmake.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-cmake.mk +1 -1
@@ -87,7 +87,7 @@ define $(2)_CONFIGURE_CMDS PATH=$$(BR_PATH) \ $$($$(PKG)_CONF_ENV) $$(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \ -DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake" \ - -DCMAKE_BUILD_TYPE=$$(if $$(BR2_ENABLE_DEBUG),Debug,Release) \ + -DCMAKE_BUILD_TYPE=$$(if $$(BR2_ENABLE_DEBUG),Debug,$$(if $$(BR2_OPTIMIZE_S),MinSizeRel,Release) \ -DCMAKE_INSTALL_PREFIX="/usr" \ -DCMAKE_COLOR_MAKEFILE=OFF \ -DBUILD_DOC=OFF \
Signature · 1 line
2.7.0
PATCH 1/1 package/pkg-cmake: use MinSizeRel for size optimized build
Dear J?rg Krause,
Quoted 13 lines · J?rg Krause
MinSizeRel sets the gcc compiler optimization level to '-Os' whereas Release sets it to '-O3'.
Signed-off-by J?rg Krause <[email protected]>--- package/pkg-cmake.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)package/pkg-cmake.mk +0
-0
package/pkg-cmake.mk define $(2)_CONFIGURE_CMDS · line 90
Quoted 5 lines
package/pkg-cmake.mk +1
-1@@ -87,7 +87,7 @@ define $(2)_CONFIGURE_CMDS PATH=$$(BR_PATH) \ $$($$(PKG)_CONF_ENV) $$(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \ -DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake" \ - -DCMAKE_BUILD_TYPE=$$(if $$(BR2_ENABLE_DEBUG),Debug,Release) \ + -DCMAKE_BUILD_TYPE=$$(if $$(BR2_ENABLE_DEBUG),Debug,$$(if $$(BR2_OPTIMIZE_S),MinSizeRel,Release) \
Looks good, but instead of this, can't CMake be taught to use Buildroot CFLAGS, which have our own -O<value> ?
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com