Skip to content

Incorrect Default Build Type in CMakeLists.txt #8

@reapersy

Description

@reapersy

The CMakeLists.txt file specifies "Release" as the default build type in the following lines:

if(NOT CMAKE_BUILD_TYPE)
  set(CMAKE_BUILD_TYPE
    "Release"
    CACHE
    STRING
    "Build mode ('DebugSan' or 'Debug' or 'Release', default is 'Debug')"
    FORCE)
endif()

However, the comment indicates that the default should be 'Debug'. This discrepancy can lead to confusion and potentially unintended builds in the release mode when the user expects a debug build.

Steps to Reproduce:

  1. Clone the repository.
  2. Create a build directory and run cmake ...
  3. Observe the default build type set in the generated CMakeCache.txt file.

Expected Behavior:
The default build type should be 'Debug' as indicated by the comment.

Actual Behavior:
The default build type is set to 'Release'.

Proposed Solution:
Update the CMakeLists.txt to set the default build type to 'Debug' to align with the comment.

if(NOT CMAKE_BUILD_TYPE)
  set(CMAKE_BUILD_TYPE
    "Debug"
    CACHE
    STRING
    "Build mode ('DebugSan' or 'Debug' or 'Release', default is 'Debug')"
    FORCE)
endif()

Additional Context:
Ensuring the default build type is correctly set to 'Debug' will help developers catch issues early during development and align with the documented behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions