Alexander Afanasyev | 97e4cac | 2014-03-28 10:55:11 -0700 | [diff] [blame] | 1 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
Alexander Afanasyev | 97e4cac | 2014-03-28 10:55:11 -0700 | [diff] [blame] | 2 | |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 3 | import platform |
Davide Pesavento | 0064c1d | 2018-03-03 18:43:53 -0500 | [diff] [blame] | 4 | from waflib import Configure, Logs, Utils |
Alexander Afanasyev | 97e4cac | 2014-03-28 10:55:11 -0700 | [diff] [blame] | 5 | |
| 6 | def options(opt): |
Davide Pesavento | 0064c1d | 2018-03-03 18:43:53 -0500 | [diff] [blame] | 7 | opt.add_option('--debug', '--with-debug', action='store_true', default=False, |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 8 | help='Compile in debugging mode with minimal optimizations (-Og)') |
Alexander Afanasyev | 97e4cac | 2014-03-28 10:55:11 -0700 | [diff] [blame] | 9 | |
| 10 | def configure(conf): |
Davide Pesavento | c0a5a39 | 2017-08-19 16:49:30 -0400 | [diff] [blame] | 11 | conf.start_msg('Checking C++ compiler version') |
| 12 | |
Davide Pesavento | 0064c1d | 2018-03-03 18:43:53 -0500 | [diff] [blame] | 13 | cxx = conf.env.CXX_NAME # generic name of the compiler |
| 14 | ccver = tuple(int(i) for i in conf.env.CC_VERSION) |
| 15 | ccverstr = '.'.join(conf.env.CC_VERSION) |
Davide Pesavento | c0a5a39 | 2017-08-19 16:49:30 -0400 | [diff] [blame] | 16 | errmsg = '' |
| 17 | warnmsg = '' |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 18 | if cxx == 'gcc': |
Davide Pesavento | 5f35f64 | 2018-05-10 19:36:03 -0400 | [diff] [blame] | 19 | if ccver < (5, 3, 0): |
Davide Pesavento | c0a5a39 | 2017-08-19 16:49:30 -0400 | [diff] [blame] | 20 | errmsg = ('The version of gcc you are using is too old.\n' |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 21 | 'The minimum supported gcc version is 7.4.0.') |
| 22 | elif ccver < (7, 4, 0): |
| 23 | warnmsg = ('Using a version of gcc older than 7.4.0 is not ' |
| 24 | 'officially supported and may result in build failures.') |
Alexander Afanasyev | b522070 | 2017-09-21 18:57:00 -0400 | [diff] [blame] | 25 | conf.flags = GccFlags() |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 26 | elif cxx == 'clang': |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 27 | if Utils.unversioned_sys_platform() == 'darwin' and ccver < (9, 0, 0): |
| 28 | errmsg = ('The version of Xcode you are using is too old.\n' |
| 29 | 'The minimum supported Xcode version is 9.0.') |
| 30 | elif ccver < (4, 0, 0): |
Davide Pesavento | c0a5a39 | 2017-08-19 16:49:30 -0400 | [diff] [blame] | 31 | errmsg = ('The version of clang you are using is too old.\n' |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 32 | 'The minimum supported clang version is 4.0.') |
Alexander Afanasyev | b522070 | 2017-09-21 18:57:00 -0400 | [diff] [blame] | 33 | conf.flags = ClangFlags() |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 34 | else: |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 35 | warnmsg = '%s compiler is unsupported' % cxx |
Alexander Afanasyev | b522070 | 2017-09-21 18:57:00 -0400 | [diff] [blame] | 36 | conf.flags = CompilerFlags() |
Davide Pesavento | c0a5a39 | 2017-08-19 16:49:30 -0400 | [diff] [blame] | 37 | |
| 38 | if errmsg: |
Davide Pesavento | 0064c1d | 2018-03-03 18:43:53 -0500 | [diff] [blame] | 39 | conf.end_msg(ccverstr, color='RED') |
Davide Pesavento | c0a5a39 | 2017-08-19 16:49:30 -0400 | [diff] [blame] | 40 | conf.fatal(errmsg) |
| 41 | elif warnmsg: |
Davide Pesavento | 0064c1d | 2018-03-03 18:43:53 -0500 | [diff] [blame] | 42 | conf.end_msg(ccverstr, color='YELLOW') |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 43 | Logs.warn('WARNING: ' + warnmsg) |
Davide Pesavento | c0a5a39 | 2017-08-19 16:49:30 -0400 | [diff] [blame] | 44 | else: |
Davide Pesavento | 0064c1d | 2018-03-03 18:43:53 -0500 | [diff] [blame] | 45 | conf.end_msg(ccverstr) |
Davide Pesavento | 1bdef28 | 2014-04-08 20:59:50 +0200 | [diff] [blame] | 46 | |
Alexander Afanasyev | b522070 | 2017-09-21 18:57:00 -0400 | [diff] [blame] | 47 | conf.areCustomCxxflagsPresent = (len(conf.env.CXXFLAGS) > 0) |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 48 | |
Davide Pesavento | c0822fa | 2018-05-10 21:54:10 -0400 | [diff] [blame] | 49 | # General flags are always applied (e.g., selecting C++ language standard) |
Alexander Afanasyev | b522070 | 2017-09-21 18:57:00 -0400 | [diff] [blame] | 50 | generalFlags = conf.flags.getGeneralFlags(conf) |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 51 | conf.add_supported_cxxflags(generalFlags['CXXFLAGS']) |
| 52 | conf.add_supported_linkflags(generalFlags['LINKFLAGS']) |
| 53 | conf.env.DEFINES += generalFlags['DEFINES'] |
| 54 | |
Alexander Afanasyev | b522070 | 2017-09-21 18:57:00 -0400 | [diff] [blame] | 55 | @Configure.conf |
| 56 | def check_compiler_flags(conf): |
Davide Pesavento | f485d89 | 2015-10-02 02:00:54 +0200 | [diff] [blame] | 57 | # Debug or optimized CXXFLAGS and LINKFLAGS are applied only if the |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 58 | # corresponding environment variables are not set. |
Davide Pesavento | f485d89 | 2015-10-02 02:00:54 +0200 | [diff] [blame] | 59 | # DEFINES are always applied. |
Alexander Afanasyev | 97e4cac | 2014-03-28 10:55:11 -0700 | [diff] [blame] | 60 | if conf.options.debug: |
Alexander Afanasyev | b522070 | 2017-09-21 18:57:00 -0400 | [diff] [blame] | 61 | extraFlags = conf.flags.getDebugFlags(conf) |
| 62 | if conf.areCustomCxxflagsPresent: |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 63 | missingFlags = [x for x in extraFlags['CXXFLAGS'] if x not in conf.env.CXXFLAGS] |
Davide Pesavento | 0064c1d | 2018-03-03 18:43:53 -0500 | [diff] [blame] | 64 | if missingFlags: |
| 65 | Logs.warn('Selected debug mode, but CXXFLAGS is set to a custom value "%s"' |
| 66 | % ' '.join(conf.env.CXXFLAGS)) |
| 67 | Logs.warn('Default flags "%s" will not be used' % ' '.join(missingFlags)) |
Alexander Afanasyev | 97e4cac | 2014-03-28 10:55:11 -0700 | [diff] [blame] | 68 | else: |
Alexander Afanasyev | b522070 | 2017-09-21 18:57:00 -0400 | [diff] [blame] | 69 | extraFlags = conf.flags.getOptimizedFlags(conf) |
Alexander Afanasyev | 97e4cac | 2014-03-28 10:55:11 -0700 | [diff] [blame] | 70 | |
Alexander Afanasyev | b522070 | 2017-09-21 18:57:00 -0400 | [diff] [blame] | 71 | if not conf.areCustomCxxflagsPresent: |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 72 | conf.add_supported_cxxflags(extraFlags['CXXFLAGS']) |
Davide Pesavento | ed89ccc | 2015-11-01 20:35:04 +0100 | [diff] [blame] | 73 | conf.add_supported_linkflags(extraFlags['LINKFLAGS']) |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 74 | |
| 75 | conf.env.DEFINES += extraFlags['DEFINES'] |
Davide Pesavento | ab1e8f2 | 2014-10-21 22:45:33 +0200 | [diff] [blame] | 76 | |
Alexander Afanasyev | 97e4cac | 2014-03-28 10:55:11 -0700 | [diff] [blame] | 77 | @Configure.conf |
| 78 | def add_supported_cxxflags(self, cxxflags): |
| 79 | """ |
| 80 | Check which cxxflags are supported by compiler and add them to env.CXXFLAGS variable |
| 81 | """ |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 82 | if len(cxxflags) == 0: |
| 83 | return |
| 84 | |
Davide Pesavento | ab1e8f2 | 2014-10-21 22:45:33 +0200 | [diff] [blame] | 85 | self.start_msg('Checking supported CXXFLAGS') |
Alexander Afanasyev | 97e4cac | 2014-03-28 10:55:11 -0700 | [diff] [blame] | 86 | |
| 87 | supportedFlags = [] |
Alexander Afanasyev | b522070 | 2017-09-21 18:57:00 -0400 | [diff] [blame] | 88 | for flags in cxxflags: |
| 89 | flags = Utils.to_list(flags) |
| 90 | if self.check_cxx(cxxflags=['-Werror'] + flags, mandatory=False): |
| 91 | supportedFlags += flags |
Alexander Afanasyev | 97e4cac | 2014-03-28 10:55:11 -0700 | [diff] [blame] | 92 | |
Davide Pesavento | 1bdef28 | 2014-04-08 20:59:50 +0200 | [diff] [blame] | 93 | self.end_msg(' '.join(supportedFlags)) |
Davide Pesavento | 67f3027 | 2016-08-10 01:55:16 +0000 | [diff] [blame] | 94 | self.env.prepend_value('CXXFLAGS', supportedFlags) |
Davide Pesavento | ab1e8f2 | 2014-10-21 22:45:33 +0200 | [diff] [blame] | 95 | |
| 96 | @Configure.conf |
| 97 | def add_supported_linkflags(self, linkflags): |
| 98 | """ |
| 99 | Check which linkflags are supported by compiler and add them to env.LINKFLAGS variable |
| 100 | """ |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 101 | if len(linkflags) == 0: |
| 102 | return |
| 103 | |
Davide Pesavento | ab1e8f2 | 2014-10-21 22:45:33 +0200 | [diff] [blame] | 104 | self.start_msg('Checking supported LINKFLAGS') |
| 105 | |
| 106 | supportedFlags = [] |
Alexander Afanasyev | b522070 | 2017-09-21 18:57:00 -0400 | [diff] [blame] | 107 | for flags in linkflags: |
| 108 | flags = Utils.to_list(flags) |
| 109 | if self.check_cxx(linkflags=['-Werror'] + flags, mandatory=False): |
| 110 | supportedFlags += flags |
Davide Pesavento | ab1e8f2 | 2014-10-21 22:45:33 +0200 | [diff] [blame] | 111 | |
| 112 | self.end_msg(' '.join(supportedFlags)) |
Davide Pesavento | 67f3027 | 2016-08-10 01:55:16 +0000 | [diff] [blame] | 113 | self.env.prepend_value('LINKFLAGS', supportedFlags) |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 114 | |
| 115 | |
| 116 | class CompilerFlags(object): |
Davide Pesavento | 0064c1d | 2018-03-03 18:43:53 -0500 | [diff] [blame] | 117 | def getCompilerVersion(self, conf): |
| 118 | return tuple(int(i) for i in conf.env.CC_VERSION) |
| 119 | |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 120 | def getGeneralFlags(self, conf): |
Davide Pesavento | ed89ccc | 2015-11-01 20:35:04 +0100 | [diff] [blame] | 121 | """Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are always needed""" |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 122 | return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': []} |
| 123 | |
| 124 | def getDebugFlags(self, conf): |
Davide Pesavento | ed89ccc | 2015-11-01 20:35:04 +0100 | [diff] [blame] | 125 | """Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in debug mode""" |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 126 | return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': ['_DEBUG']} |
| 127 | |
| 128 | def getOptimizedFlags(self, conf): |
Davide Pesavento | ed89ccc | 2015-11-01 20:35:04 +0100 | [diff] [blame] | 129 | """Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in optimized mode""" |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 130 | return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': ['NDEBUG']} |
| 131 | |
| 132 | class GccBasicFlags(CompilerFlags): |
Davide Pesavento | f485d89 | 2015-10-02 02:00:54 +0200 | [diff] [blame] | 133 | """ |
| 134 | This class defines basic flags that work for both gcc and clang compilers |
| 135 | """ |
Davide Pesavento | 8eb5f8f | 2017-06-24 02:19:42 -0400 | [diff] [blame] | 136 | def getGeneralFlags(self, conf): |
| 137 | flags = super(GccBasicFlags, self).getGeneralFlags(conf) |
Davide Pesavento | c0822fa | 2018-05-10 21:54:10 -0400 | [diff] [blame] | 138 | flags['CXXFLAGS'] += ['-std=c++14'] |
Davide Pesavento | dfbeda2 | 2018-12-19 01:15:48 -0500 | [diff] [blame] | 139 | if Utils.unversioned_sys_platform() == 'linux': |
| 140 | flags['LINKFLAGS'] += ['-fuse-ld=gold'] |
| 141 | elif Utils.unversioned_sys_platform() == 'freebsd': |
| 142 | flags['LINKFLAGS'] += ['-fuse-ld=lld'] |
Davide Pesavento | 8eb5f8f | 2017-06-24 02:19:42 -0400 | [diff] [blame] | 143 | return flags |
| 144 | |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 145 | def getDebugFlags(self, conf): |
| 146 | flags = super(GccBasicFlags, self).getDebugFlags(conf) |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 147 | flags['CXXFLAGS'] += ['-Og', |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 148 | '-g3', |
Davide Pesavento | ed89ccc | 2015-11-01 20:35:04 +0100 | [diff] [blame] | 149 | '-pedantic', |
| 150 | '-Wall', |
| 151 | '-Wextra', |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 152 | '-Werror', |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 153 | '-Wcatch-value=2', |
| 154 | '-Wextra-semi', |
Alexander Afanasyev | 847de40 | 2017-09-21 18:57:30 -0400 | [diff] [blame] | 155 | '-Wnon-virtual-dtor', |
Alexander Afanasyev | 436f3bd | 2016-10-11 16:37:45 -0700 | [diff] [blame] | 156 | '-Wno-error=deprecated-declarations', # Bug #3795 |
Davide Pesavento | c0a5a39 | 2017-08-19 16:49:30 -0400 | [diff] [blame] | 157 | '-Wno-error=maybe-uninitialized', # Bug #1615 |
| 158 | '-Wno-unused-parameter', |
Davide Pesavento | f485d89 | 2015-10-02 02:00:54 +0200 | [diff] [blame] | 159 | ] |
Davide Pesavento | dfbeda2 | 2018-12-19 01:15:48 -0500 | [diff] [blame] | 160 | flags['LINKFLAGS'] += ['-Wl,-O1'] |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 161 | return flags |
| 162 | |
| 163 | def getOptimizedFlags(self, conf): |
| 164 | flags = super(GccBasicFlags, self).getOptimizedFlags(conf) |
Davide Pesavento | ed89ccc | 2015-11-01 20:35:04 +0100 | [diff] [blame] | 165 | flags['CXXFLAGS'] += ['-O2', |
Davide Pesavento | f485d89 | 2015-10-02 02:00:54 +0200 | [diff] [blame] | 166 | '-g', |
Davide Pesavento | ed89ccc | 2015-11-01 20:35:04 +0100 | [diff] [blame] | 167 | '-pedantic', |
| 168 | '-Wall', |
| 169 | '-Wextra', |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 170 | '-Wcatch-value=2', |
| 171 | '-Wextra-semi', |
Alexander Afanasyev | 847de40 | 2017-09-21 18:57:30 -0400 | [diff] [blame] | 172 | '-Wnon-virtual-dtor', |
Davide Pesavento | ed89ccc | 2015-11-01 20:35:04 +0100 | [diff] [blame] | 173 | '-Wno-unused-parameter', |
Davide Pesavento | f485d89 | 2015-10-02 02:00:54 +0200 | [diff] [blame] | 174 | ] |
Davide Pesavento | dfbeda2 | 2018-12-19 01:15:48 -0500 | [diff] [blame] | 175 | flags['LINKFLAGS'] += ['-Wl,-O1'] |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 176 | return flags |
| 177 | |
| 178 | class GccFlags(GccBasicFlags): |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 179 | def getDebugFlags(self, conf): |
| 180 | flags = super(GccFlags, self).getDebugFlags(conf) |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 181 | flags['CXXFLAGS'] += ['-fdiagnostics-color', |
| 182 | '-Wredundant-tags', |
| 183 | ] |
| 184 | if platform.machine() == 'armv7l' and self.getCompilerVersion(conf) >= (7, 1, 0): |
| 185 | flags['CXXFLAGS'] += ['-Wno-psabi'] # Bug #5106 |
Davide Pesavento | f485d89 | 2015-10-02 02:00:54 +0200 | [diff] [blame] | 186 | return flags |
| 187 | |
| 188 | def getOptimizedFlags(self, conf): |
| 189 | flags = super(GccFlags, self).getOptimizedFlags(conf) |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 190 | flags['CXXFLAGS'] += ['-fdiagnostics-color', |
| 191 | '-Wredundant-tags', |
| 192 | ] |
| 193 | if platform.machine() == 'armv7l' and self.getCompilerVersion(conf) >= (7, 1, 0): |
| 194 | flags['CXXFLAGS'] += ['-Wno-psabi'] # Bug #5106 |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 195 | return flags |
| 196 | |
| 197 | class ClangFlags(GccBasicFlags): |
| 198 | def getGeneralFlags(self, conf): |
| 199 | flags = super(ClangFlags, self).getGeneralFlags(conf) |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 200 | if Utils.unversioned_sys_platform() == 'darwin': |
Davide Pesavento | 0064c1d | 2018-03-03 18:43:53 -0500 | [diff] [blame] | 201 | # Bug #4296 |
Alexander Afanasyev | b522070 | 2017-09-21 18:57:00 -0400 | [diff] [blame] | 202 | flags['CXXFLAGS'] += [['-isystem', '/usr/local/include'], # for Homebrew |
| 203 | ['-isystem', '/opt/local/include']] # for MacPorts |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 204 | elif Utils.unversioned_sys_platform() == 'freebsd': |
| 205 | # Bug #4790 |
| 206 | flags['CXXFLAGS'] += [['-isystem', '/usr/local/include']] |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 207 | return flags |
| 208 | |
| 209 | def getDebugFlags(self, conf): |
| 210 | flags = super(ClangFlags, self).getDebugFlags(conf) |
Davide Pesavento | f485d89 | 2015-10-02 02:00:54 +0200 | [diff] [blame] | 211 | flags['CXXFLAGS'] += ['-fcolor-diagnostics', |
Davide Pesavento | c0a5a39 | 2017-08-19 16:49:30 -0400 | [diff] [blame] | 212 | '-Wundefined-func-template', |
Davide Pesavento | c0a5a39 | 2017-08-19 16:49:30 -0400 | [diff] [blame] | 213 | '-Wno-unused-local-typedef', # Bugs #2657 and #3209 |
Davide Pesavento | f485d89 | 2015-10-02 02:00:54 +0200 | [diff] [blame] | 214 | ] |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 215 | if self.getCompilerVersion(conf) < (6, 0, 0): |
Davide Pesavento | 69692ab | 2018-09-11 18:11:23 -0400 | [diff] [blame] | 216 | flags['CXXFLAGS'] += ['-Wno-missing-braces'] # Bug #4721 |
Davide Pesavento | f485d89 | 2015-10-02 02:00:54 +0200 | [diff] [blame] | 217 | return flags |
| 218 | |
| 219 | def getOptimizedFlags(self, conf): |
| 220 | flags = super(ClangFlags, self).getOptimizedFlags(conf) |
| 221 | flags['CXXFLAGS'] += ['-fcolor-diagnostics', |
Davide Pesavento | c0a5a39 | 2017-08-19 16:49:30 -0400 | [diff] [blame] | 222 | '-Wundefined-func-template', |
Davide Pesavento | f485d89 | 2015-10-02 02:00:54 +0200 | [diff] [blame] | 223 | '-Wno-unused-local-typedef', # Bugs #2657 and #3209 |
| 224 | ] |
Davide Pesavento | 1752159 | 2020-05-14 19:01:32 -0400 | [diff] [blame] | 225 | if self.getCompilerVersion(conf) < (6, 0, 0): |
Davide Pesavento | 69692ab | 2018-09-11 18:11:23 -0400 | [diff] [blame] | 226 | flags['CXXFLAGS'] += ['-Wno-missing-braces'] # Bug #4721 |
Alexander Afanasyev | 7681863 | 2015-01-26 21:30:45 -0800 | [diff] [blame] | 227 | return flags |