![]() Note that I care mostly about what users may and should set on the command line in order to get the types of builds they want, not what developers should do inside the CMake configuration files (or whatever the files are called). single-config (make).īefore I encountered this issue, I was under the impression that -DWITH_DEBUG in CMake was just a translation of -with-debug from autotools, and that the proper CMake way of doing it was to specify CMAKE_BUILD_TYPE=Debug instead. John Embretsen Wlad, I think I understand most of what you are saying about the alias and multi-config (Visual Studio, XCode) vs. Violations to this rule, should be fixed. You can control compiler flags specific to configuration with CMAKE_C_FLAGS_FLAGS_DEBUG to set debug-only options. (if MTR_VS_CONFIG is not set, there is a search logic for all known types that prefers Release types to Debug) The trick for MTR, with both Visual Studio on Windows and Xcode on OSX is to set environment variable MTR_VS_CONFIG to the correct configuration, like Now, after you build can build Debug and RelWithDebInfo types, and even package them separately with e.gĭevenv /build %BUILD_TYPE% MySql.sln /project packageĪnd run mtr against it, selecting build type you want to MTR-test. Xcodebuild (command line tool to build Xcode projects) also has those types on the command line but I do not remember then off the top of my head. You can instead control type at build time rather than "cmake" time, e.gĪll from the same "project" file, or control it in VS or Xcode GUI switching the build type in the corresponding select box. DBUILD_TYPE has no meaning for here, and -DWITH_DEBUG(as shortcut or -DBUILD_TYPE=Debug) also does not have much sense. "* Makefiles" are single-config generators, Visual Studio and Xcode are multi-config.Īfter a single cmake run you'll have a "project" with multiple (4) configuration: Debug,Release, RelWithDebInfo, and MinSizeRel. This works a bit different dependent on generator. > Looking at CMakeCache.txt in pushbuild, is confusing: > Does this actually generate debug binaries, with DBUG macros etc. > cscript win\configure.js WITH_INNOBASE_STORAGE_ENGIN. > In pushbuild, they do something like this: DBUILD_CONFIG=mysql_release -DWITH_DEBUG=1 -G"Visual Studio 10" > When building on windows, I do something like this: > Subject: debug builds (or not) on windows > From: Tor Didriksen [ Sent: Monday, Novem4:33 PM I'll paste here a mail I sent to Tor recently on the similar subject Vladislav Vaintroub WITH_DEBUG is an alias for CMAKE_BUILD_TYPE=Debug, but the reverse is not true:) The comment in CMakeLists.txt that this "turns out to be not trivial" seems to be correct. If there is supposed to be two different levels of debug, make this clear in the documentation, and make the CMake script consistent with the actual behavior. ![]() ![]() So it seems like an ELSEIF(CMAKE_BUILD_TYPE MATCHES "Debug") case is missing. The current CMakeLists.txt file accounts for:ĮLSEIF(NOT HAVE_CMAKE_BUILD_TYPE OR OLD_WITH_DEBUG) Make the code in CMakeLists.txt account for the situation where CMAKE_BUILD_TYPE=Debug and WITH_DEBUG is undefined. UNIV_DEBUG is only enabled if WITH_DEBUG=1 (explicitly). You can also run an MTR test case and look for UNIV_DEBUG message printed in the top of the error log. $ cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_DEBUG=1. However, it _is_ some kind of debug build, as tests requiring this run OK. This could also be a "documentation" bug, but I would find that strange. (the above examples are out-of-source builds) However, it turns out that on Unix at least, runningĭoes not result in the same type of debug build as "# We choose to provide WITH_DEBUG as alias to standard CMAKE_BUILD_TYPE=Debug" Comments in CMakeLists.txt also indicate this: However, the first bullet should still be true. It seems this is slightly outdated, since WITH_DEBUG_FULL seems to have been removed. * Full debug (set with -DWITH_DEBUG_FULL=1) would additonally add malloc instrumentation * A typical debug build is done with -DCMAKE_BUILD_TYPE=Debug (shortcut for it is -DWITH_DEBUG=1) and this would include DBUG instrumentation, plus wrapper around pthread mutexes known as SAFE_MUTEX on Unixes. According to the MySQL CMake instructions on, the CMake options "-DCMAKE_BUILD_TYPE=Debug" and "-DWITH_DEBUG=1" should be equivalent.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |