Revert "package/cmake: with BR2_ENABLE_DEBUG use RelWithDebInfo"
authorSamuel Martin <s.martin49@gmail.com>
Sun, 16 Oct 2016 11:12:37 +0000 (13:12 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 22 Oct 2016 14:14:07 +0000 (16:14 +0200)
commit104bb29e0490bfb487e2e665448dd3ca07fcc2b5
treec4c342b11d8c1288fb86d7da76b7a2a882631806
parent637c1372bb9b5d7874cb2b365547ab12dbf0ad9f
Revert "package/cmake: with BR2_ENABLE_DEBUG use RelWithDebInfo"

This reverts commit 4b0120183404913f7f7788ef4f0f6b51498ef363.

Before reverting this patch, CMake packages are built with the following
options:
  * if BR2_ENABLE_DEBUG is set:
    The CMake build type is set to RelWithDebInfo, which means:
    - Optimization level is forced to: -O2;
    - no log nor assert due to -DNDEBUG;
    - BR2_DEBUG_{1..3} effect is unchanged;
  * otherwise:
    The CMake build type is set to Release, which means:
    - Optimization level is forced to: -O3;
    - no log nor assert due to -DNDEBUG (as expected).
  In any case, the optimization WRT the binary size is always ignored
  and forced.

Reverting to the previous situation, so Buildroot now chooses between
the 'Debug' and 'Release' config types, which are semantically closer
to what Buildroot does everywhere else:
  * if BR2_ENABLE_DEBUG is set:
    The CMake build type is set to Debug, which means:
    - only -g option is passed by CMake;
    - optimization is not forced, nor debug level, so they are kept
      as-is;
  * otherwise:
    The CMake build type is set to Release, so no change in this case:
    - Optimization level is forced to: -O3;
    - no log nor assert due to -DNDEBUG (as expected);
    - size optimization is ignored.

Follow-up patches will fix the CMake flag variables that are appended by
CMake.

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