-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Feature Request] Add 'default' to optimization and debug #8214
Comments
The general recommendation for linux distro builds where system distributors want to closely control the CFLAGS etc. used, is to use Configuring a build directory like that does indeed result in If we added "default", is this something that the plain buildtype should start using? |
I wish I could answer this question, but as an example, MSVC and Intel's compiler, which use the same flags, have different default behaviors. MSVC will use
That may work on linux via gcc and some other compilers, but I looked through the source code and there are many compiler's whose As an example, if I set This is why I propose
This honestly makes more sense to me than what we are currently using. As an example, I am trying to port over a complicated build system with tried/true cc/cxx flags, and the maintainers want to have very precise control over the flags. We can kind of do that on linux, because it so happens that Using this allows to also specify the targets unobtrusively through a custom argument, such as if get_option('target') != 'custom' and get_option('optimization') != 'default' and get_option('debug') != 'default'
# have control for our very specific cc_flags
else
# the user has specified custom optimization and debug levels
endif |
This is a first step to make `buildtype` a true alias of `debug` and `optimization` options. See mesonbuild#10808. Relates to: - mesonbuild#11645 - mesonbuild#12096 - mesonbuild#5920 - mesonbuild#5814 - mesonbuild#8220 - mesonbuild#8493 - mesonbuild#9540 - mesonbuild#10487 - mesonbuild#12265 - mesonbuild#8308 - mesonbuild#8214 - mesonbuild#7194 - mesonbuild#11732
This is a first step to make `buildtype` a true alias of `debug` and `optimization` options. See mesonbuild#10808. Relates to: - mesonbuild#11645 - mesonbuild#12096 - mesonbuild#5920 - mesonbuild#5814 - mesonbuild#8220 - mesonbuild#8493 - mesonbuild#9540 - mesonbuild#10487 - mesonbuild#12265 - mesonbuild#8308 - mesonbuild#8214 - mesonbuild#7194 - mesonbuild#11732
This is a first step to make `buildtype` a true alias of `debug` and `optimization` options. See mesonbuild#10808. Relates to: - mesonbuild#11645 - mesonbuild#12096 - mesonbuild#5920 - mesonbuild#5814 - mesonbuild#8220 - mesonbuild#8493 - mesonbuild#9540 - mesonbuild#10487 - mesonbuild#12265 - mesonbuild#8308 - mesonbuild#8214 - mesonbuild#7194 - mesonbuild#11732
Since 0.64, meson now has |
This is a first step to make `buildtype` a true alias of `debug` and `optimization` options. See mesonbuild#10808. Relates to: - mesonbuild#11645 - mesonbuild#12096 - mesonbuild#5920 - mesonbuild#5814 - mesonbuild#8220 - mesonbuild#8493 - mesonbuild#9540 - mesonbuild#10487 - mesonbuild#12265 - mesonbuild#8308 - mesonbuild#8214 - mesonbuild#7194 - mesonbuild#11732
It would be a good idea to add a 'default' option to both the optimization and debug built-in options.
Currently, trying to create custom build-types for certain projects have proven to be impossible due to meson options conflicting with user supplied arguments.
I propose that a
default
option be added, that does not add any additional optimization or debug flags to the compiler.e.g.
optimization={default,0,g,1,2,3}
debug={default,true,false}
After going through the mixins, as well as analyzing compiler docs, it seems there is no easy solution.
Each compiler has a different default state, for example some compilers have their default set to zero optimizations, while some have it set to some optimizations. Enforcing that
optimization=0
adds zero arguments would create inconsistency between compilers as well.And maintaining a custom filter list for every compiler would be difficult (e.g. detecting that if a user specifies any
/O$
option in MSVC, to remove anything added by meson).The text was updated successfully, but these errors were encountered: