Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-22989

Make cmake error out when unsupported option is passed as CMAKE_BUILD_TYPE

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.11
    • Compiling
    • None

    Description

      A mistake that seems to be quite common, which I currently experienced whilst investigating a `DBUG_SYNC` test failure reported by monty, is that it is actually possible to pass ` -DCMAKE_BUILD_TYPE=mysql_release` to cmake, even though `mysql_release` is a `BUILD_CONFIG` not a `BUILD_TYPE`.
      In this case the build continues just fine, but all sorts of undefined things happen with the server code because odd combinations of `#define` happen when they shouldn't.

      We should make cmake fail if an unsupported option is passed as `BUILD_TYPE`.

      Attachments

        Activity

          wlad Vladislav Vaintroub added a comment - - edited

          The other option, is to fix #define puzzle, e.g DBUG_SYNC would really only be in effect depending on DBUG_OFF.

          I think ideally we should be building fine, with no extra preprocessor definitions passed to the compiler. Surprisingly this will also build DBUG on

          We could still warn ( at cmake phase that the configuration is not known , but dying might not be the best idea.

          wlad Vladislav Vaintroub added a comment - - edited The other option, is to fix #define puzzle, e.g DBUG_SYNC would really only be in effect depending on DBUG_OFF. I think ideally we should be building fine, with no extra preprocessor definitions passed to the compiler. Surprisingly this will also build DBUG on We could still warn ( at cmake phase that the configuration is not known , but dying might not be the best idea.

          People

            Unassigned Unassigned
            robertbindar Robert Bindar
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.