Bug #70647 -DWITH_DEBUG=1 has more effects than -DCMAKE_BUILD_TYPE=Debug
Submitted: 17 Oct 2013 12:12 Modified: 3 Apr 2014 15:17
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.6 OS:Any
Assigned to: CPU Architecture:Any
Tags: build, cmake, debug

[17 Oct 2013 12:12] Laurynas Biveinis
The docs for -DCMAKE_BUILD_TYPE=Debug at https://dev.mysql.com/doc/refman/5.6/en/source-configuration-options.html#option_cmake_cma... state that 

"That is, -DWITH_DEBUG=1 has the same effect as -DCMAKE_BUILD_TYPE=Debug. "

which leaves some room for interpretation, but is IMHO confusing in any case, as -DWITH_DEBUG=1 enables a superset of -DCMAKE_BUILD_TYPE=Debug features. At least the safe mutexes are enabled if the former option is specified and not enabled if the latter one is specified.

This is either a doc bug if the mismatch between the two is intended, or a CMake bug if it's not.

This already has been reported as bug 58231, but that one was closed as duplicate of bug 58279, which addressed UNIV_DEBUG only.

How to repeat:
Build with these two options separately and safe mutexes will be present in one build but missing in another.

Suggested fix:
Clarify docs or make options identical.
[21 Oct 2013 9:57] Umesh Shastry
Hello Laurynas,

Thank you for the bug report.

[13 Feb 2014 18:21] Paul Dubois
Noted in 5.7.4 changelog.

Configuring with -DWITH_DEBUG=1 did not have the same effect as
configuring with -DCMAKE_BUILD_TYPE=Debug.
[3 Apr 2014 15:17] Laurynas Biveinis
5.7$ bzr log -r 7460
revno: 7460
committer: Tor Didriksen <tor.didriksen@oracle.com>
branch nick: trunk-cmake
timestamp: Wed 2014-02-12 09:39:51 +0100
  -DWITH_DEBUG=1 should have the same effect as -DCMAKE_BUILD_TYPE=Debug