pkg-cmake.mk: globally drive the CMAKE_BUILD_TYPE flag using BR2_ENABLE_DEBUG
authorSamuel Martin <s.martin49@gmail.com>
Sun, 1 Jun 2014 09:24:29 +0000 (11:24 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 1 Jun 2014 20:19:36 +0000 (22:19 +0200)
This CMake flag is usually used to adjust compiler flags (like: -Ox, -g,
etc).

So, it makes sense for Buildroot to globally drive this CMake flags in
the cmake-package infrastructure.

However, if a package prefer overriding this default setting, it still
can via the <PKG>_CONF_OPT variable.

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/pkg-cmake.mk

index 6331e0f3e7e4c385481cb1737ce697fa5fb5cb48..fb8144e87b0c4aca0dafe490bba9bfcbf8f03eb1 100644 (file)
@@ -63,6 +63,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_INSTALL_PREFIX="/usr" \
                -DCMAKE_COLOR_MAKEFILE=OFF \
                -DBUILD_TESTING=OFF \