Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base \MD[d] and \MT[d] off of 'debug' instead of 'buildtype' #8220

Closed
wants to merge 2 commits into from

Conversation

marstaik
Copy link
Contributor

@marstaik marstaik commented Jan 18, 2021

Currently, the msvc the automatic crt flag detection is based off of buildtype, this PR would change it to be based off of debug for the following reasons.

  • The [d] suffix on either \MD or \MT directly correlates to whether or not _DEBUG is defined, and many projects depend on _DEBUG being defined by msvc when debug information is actually built. Currently, buildtype will turn off the debug information on debugoptimized.
  • Mixing custom optimization and debug levels causes buildtype=custom, which throws the following exception:
    Requested C runtime based on buildtype, but buildtype is "custom".
    • Current behavior requires a user to manually specify the vs crt in this case, which adds complexity
    • I do not believe a default option should cause exceptions to be thrown.

@marstaik marstaik force-pushed the crt branch 2 times, most recently from 8083fc7 to bc6b697 Compare January 18, 2021 21:14
@jpakkane
Copy link
Member

Currently, buildtype will turn off the debug information on debugoptimized.

There is an unfortunate clash of terminology here. Meson uses the unixy terms where "debug" means "-g", that is, debug info is generated. MSVC uses "debug" to mean whether the debug runtime is used (for GCC it would mean roughly the same as using -D_GLIBXCC_DEBUG=1). I'm guessing that you meant the latter here, because debugoptimized most definitely has debug info enabled.

Because of this setting this option based on Meson's debug option does not seem right as it is enabled in release builds (because otherwise you can't debug stack traces from crashes in the field). See also #8191 for documentation update on what the buildtype option is meant to convey in the future.

Current behavior requires a user to manually specify the vs crt in this case, which adds complexity

An alternative would be to change it so that for custom it adds no flags at all.

bruchar1 added a commit to bruchar1/meson that referenced this pull request Dec 1, 2023
bruchar1 added a commit to bruchar1/meson that referenced this pull request Dec 2, 2023
bruchar1 added a commit to bruchar1/meson that referenced this pull request Dec 5, 2023
jpakkane pushed a commit that referenced this pull request Dec 23, 2023
This is a first step to make `buildtype` a true alias of `debug` and
`optimization` options.

See #10808.

Relates to:
- #11645
- #12096
- #5920
- #5814
- #8220
- #8493
- #9540
- #10487
- #12265
- #8308
- #8214
- #7194
- #11732
@bruchar1
Copy link
Member

bruchar1 commented Jan 3, 2024

As @jpakkane explained, this is wrong as 'debug' means 'generate debug info'. This PR should be closed.

@bruchar1 bruchar1 closed this Jan 5, 2024
bruchar1 added a commit to bruchar1/meson that referenced this pull request Jan 12, 2024
The current debug option is confusing, because people think it means
buildtype=debug while it is about the generation of debug information.

See mesonbuild#10808 for a discusion proposing it.

See mesonbuild#8220 for an example of possible confusion.
bruchar1 added a commit to bruchar1/meson that referenced this pull request Jan 12, 2024
The current debug option is confusing, because people think it means
buildtype=debug while it is about the generation of debug information.

See mesonbuild#10808 for a discusion proposing it.

See mesonbuild#8220 for an example of possible confusion.
bruchar1 added a commit to bruchar1/meson that referenced this pull request Jan 12, 2024
The current debug option is confusing, because people think it means
buildtype=debug while it is about the generation of debug information.

See mesonbuild#10808 for a discusion proposing it.

See mesonbuild#8220 for an example of possible confusion.
bruchar1 added a commit to bruchar1/meson that referenced this pull request Feb 12, 2024
The current debug option is confusing, because people think it means
buildtype=debug while it is about the generation of debug information.

See mesonbuild#10808 for a discusion proposing it.

See mesonbuild#8220 for an example of possible confusion.
gerioldman pushed a commit to gerioldman/meson that referenced this pull request Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants