diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-03-07 01:49:30 +0530 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2020-03-11 07:11:59 -0400 |
commit | 69e9d32bca23d75a9a5d7df794d34c9aeb949d8a (patch) | |
tree | e69287358bd3dc77a4214c46176a83046908bbd3 /mesonbuild | |
parent | bd953b6b2977eb9d9afb92208f117dd8845a3088 (diff) | |
download | meson-69e9d32bca23d75a9a5d7df794d34c9aeb949d8a.zip meson-69e9d32bca23d75a9a5d7df794d34c9aeb949d8a.tar.gz meson-69e9d32bca23d75a9a5d7df794d34c9aeb949d8a.tar.bz2 |
coredata: Warn on usage of both -Dbuildtype and -Doptimization/-Ddebug
It may not be obvious to users that these two ways to set build-types
override each other and specifying both is redundant, and conflicts
are resolved based on whichever is specified later.
Closes https://github.com/mesonbuild/meson/issues/6742
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/coredata.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index 344da4c..6f75534 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -718,6 +718,13 @@ class CoreData: self.copy_build_options_from_regular_ones() def set_default_options(self, default_options, subproject, env): + # Warn if the user is using two different ways of setting build-type + # options that override each other + if 'buildtype' in env.cmd_line_options and \ + ('optimization' in env.cmd_line_options or 'debug' in env.cmd_line_options): + mlog.warning('Recommend using either -Dbuildtype or -Doptimization + -Ddebug. ' + 'Using both is redundant since they override each other. ' + 'See: https://mesonbuild.com/Builtin-options.html#build-type-options') cmd_line_options = OrderedDict() # Set project default_options as if they were passed to the cmdline. # Subprojects can only define default for user options and not yielding |