Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-9189

Add the build type RelWithDebInfo to CMake

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT11.0.0, 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • 3
    • Storage - Ra 2022-05-02

      Summary
      We would like to be able to use the build type RelWithDebInfo when compiling with CMake. In other words, with optimizations and with debug info.

      Motivation

      • Does this affect any team outside of WT?
        No
      • Is this issue urgent?
        Not really but increases the team productivity as we could set flags faster.

      Acceptance Criteria (Definition of Done)
      Be able to use -DCMAKE_BUILD_TYPE=RelWithDebInfo when configuring the build.

      We might want to update any documentation where the build types are mentioned.

      Suggested Solution

      diff --git a/cmake/configs/modes.cmake b/cmake/configs/modes.cmake
      index c518a8c2a..1d0bb897a 100644
      --- a/cmake/configs/modes.cmake
      +++ b/cmake/configs/modes.cmake
      @@ -5,7 +5,7 @@ include(CheckCXXCompilerFlag)
       include(${CMAKE_SOURCE_DIR}/cmake/helpers.cmake)
       
       # Establish an internal cache variable to track our custom build modes.
      -set(BUILD_MODES None Debug Release CACHE INTERNAL "")
      +set(BUILD_MODES None Debug Release RelWithDebInfo CACHE INTERNAL "")
      

      Not sure about the following:

      diff --git a/cmake/configs/base.cmake b/cmake/configs/base.cmake
      index d3df936e5..e5fbdfad8 100644
      --- a/cmake/configs/base.cmake
      +++ b/cmake/configs/base.cmake
      @@ -248,7 +248,7 @@ config_string(
           DEFAULT "\"${WT_VERSION_STRING}\""
       )
       
      -if(HAVE_DIAGNOSTIC AND (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug"))
      +if(HAVE_DIAGNOSTIC AND (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo"))
      

            Assignee:
            etienne.petrel@mongodb.com Etienne Petrel
            Reporter:
            etienne.petrel@mongodb.com Etienne Petrel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: