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

[Docs] Difference between buildtype=plain and buildtype=custom #7194

Open
Neumann-A opened this issue May 23, 2020 · 2 comments
Open

[Docs] Difference between buildtype=plain and buildtype=custom #7194

Neumann-A opened this issue May 23, 2020 · 2 comments

Comments

@Neumann-A
Copy link
Contributor

Can somebody explain what exactly the difference here is?

for plain the explanation is:

no extra build flags are used, even for compiler warnings, useful for distro packagers and other cases where you need to specify all arguments by yourself

but from my point of view i also sometimes want to add the flag -Ddebug=true which changes the buildtype to custom?
Are custom and plain basically the same buildtypes just with different names?

@Bassem-Ramzy
Copy link

Bassem-Ramzy commented Jan 19, 2022

I understand that:

  1. plain is false debug and 0 optimization, while custom should be different in either or both of them.
  2. You can select plain as a build type in flag -Dbuildtype=plain, but doing -Dbuildtype=custom has no meaning if you didn't set different flags values, and has no meaning to be passed if you set different flags values as it will be concluded by meson automatically.
  3. Build type, if not defined using -Dbuildtype, will be concluded by meson based on other flags values , as per meson documentation:

For setting optimization levels and toggling debug, you can either set the buildtype option, or you can set the optimization and debug options which give finer control over the same. Whichever you decide to use, the other will be deduced from it. For example, -Dbuildtype=debugoptimized is the same as -Ddebug=true -Doptimization=2 and vice-versa.

  1. As a conclusion, custom build type is set automatically by meson when you select combination of flags that don't comply with one of plain, debug, debugoptimized, release, minsize build types as per the "two-way mapping" table.

@mpontillo
Copy link

Similarly, I'm confused about the following:

buildtype debug optimization
plain false plain
debug true 0

I was debugging a binary built with --buildmode=plain and gdb kept telling me that values had been <optimized out>. So I thought to turn off optimization, but the difference between plain and 0 isn't clear to me.

bruchar1 added a commit to bruchar1/meson that referenced this issue Dec 1, 2023
bruchar1 added a commit to bruchar1/meson that referenced this issue Dec 2, 2023
bruchar1 added a commit to bruchar1/meson that referenced this issue Dec 5, 2023
jpakkane pushed a commit that referenced this issue 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
gerioldman pushed a commit to gerioldman/meson that referenced this issue 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

No branches or pull requests

3 participants