Alexander Afanasyev | 5e1288e | 2014-03-28 11:11:48 -0700 | [diff] [blame] | 1 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
Alexander Afanasyev | 5e1288e | 2014-03-28 11:11:48 -0700 | [diff] [blame] | 2 | |
Davide Pesavento | 71c622b | 2020-04-24 01:39:01 -0400 | [diff] [blame] | 3 | import platform |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 4 | from waflib import Configure, Logs, Utils |
Alexander Afanasyev | 5e1288e | 2014-03-28 11:11:48 -0700 | [diff] [blame] | 5 | |
| 6 | def options(opt): |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 7 | opt.add_option('--debug', '--with-debug', action='store_true', default=False, |
Davide Pesavento | 71c622b | 2020-04-24 01:39:01 -0400 | [diff] [blame] | 8 | help='Compile in debugging mode with minimal optimizations (-Og)') |
Alexander Afanasyev | 5e1288e | 2014-03-28 11:11:48 -0700 | [diff] [blame] | 9 | |
| 10 | def configure(conf): |
Davide Pesavento | 88a0d81 | 2017-08-19 21:31:42 -0400 | [diff] [blame] | 11 | conf.start_msg('Checking C++ compiler version') |
| 12 | |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -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 | 88a0d81 | 2017-08-19 21:31:42 -0400 | [diff] [blame] | 16 | errmsg = '' |
| 17 | warnmsg = '' |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 18 | if cxx == 'gcc': |
Davide Pesavento | 844b093 | 2018-05-07 01:00:16 -0400 | [diff] [blame] | 19 | if ccver < (5, 3, 0): |
Davide Pesavento | 88a0d81 | 2017-08-19 21:31:42 -0400 | [diff] [blame] | 20 | errmsg = ('The version of gcc you are using is too old.\n' |
Davide Pesavento | 71c622b | 2020-04-24 01:39:01 -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 | b82d8c3 | 2017-09-21 11:35:07 -0400 | [diff] [blame] | 25 | conf.flags = GccFlags() |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 26 | elif cxx == 'clang': |
Davide Pesavento | 71c622b | 2020-04-24 01:39:01 -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 | 88a0d81 | 2017-08-19 21:31:42 -0400 | [diff] [blame] | 31 | errmsg = ('The version of clang you are using is too old.\n' |
Davide Pesavento | 71c622b | 2020-04-24 01:39:01 -0400 | [diff] [blame] | 32 | 'The minimum supported clang version is 4.0.') |
Alexander Afanasyev | b82d8c3 | 2017-09-21 11:35:07 -0400 | [diff] [blame] | 33 | conf.flags = ClangFlags() |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 34 | else: |
Davide Pesavento | 71c622b | 2020-04-24 01:39:01 -0400 | [diff] [blame] | 35 | warnmsg = '%s compiler is unsupported' % cxx |
Alexander Afanasyev | b82d8c3 | 2017-09-21 11:35:07 -0400 | [diff] [blame] | 36 | conf.flags = CompilerFlags() |
Davide Pesavento | 88a0d81 | 2017-08-19 21:31:42 -0400 | [diff] [blame] | 37 | |
| 38 | if errmsg: |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 39 | conf.end_msg(ccverstr, color='RED') |
Davide Pesavento | 88a0d81 | 2017-08-19 21:31:42 -0400 | [diff] [blame] | 40 | conf.fatal(errmsg) |
| 41 | elif warnmsg: |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 42 | conf.end_msg(ccverstr, color='YELLOW') |
Davide Pesavento | 71c622b | 2020-04-24 01:39:01 -0400 | [diff] [blame] | 43 | Logs.warn('WARNING: ' + warnmsg) |
Davide Pesavento | 88a0d81 | 2017-08-19 21:31:42 -0400 | [diff] [blame] | 44 | else: |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 45 | conf.end_msg(ccverstr) |
Alexander Afanasyev | b78bc4d | 2014-04-09 21:20:52 -0700 | [diff] [blame] | 46 | |
Alexander Afanasyev | b82d8c3 | 2017-09-21 11:35:07 -0400 | [diff] [blame] | 47 | conf.areCustomCxxflagsPresent = (len(conf.env.CXXFLAGS) > 0) |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 48 | |
Davide Pesavento | 1fd0024 | 2018-05-20 00:11:01 -0400 | [diff] [blame] | 49 | # General flags are always applied (e.g., selecting C++ language standard) |
Alexander Afanasyev | b82d8c3 | 2017-09-21 11:35:07 -0400 | [diff] [blame] | 50 | generalFlags = conf.flags.getGeneralFlags(conf) |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -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 | b82d8c3 | 2017-09-21 11:35:07 -0400 | [diff] [blame] | 55 | @Configure.conf |
| 56 | def check_compiler_flags(conf): |
Davide Pesavento | d06ea05 | 2015-10-02 01:48:24 +0200 | [diff] [blame] | 57 | # Debug or optimized CXXFLAGS and LINKFLAGS are applied only if the |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 58 | # corresponding environment variables are not set. |
Davide Pesavento | d06ea05 | 2015-10-02 01:48:24 +0200 | [diff] [blame] | 59 | # DEFINES are always applied. |
Alexander Afanasyev | 5e1288e | 2014-03-28 11:11:48 -0700 | [diff] [blame] | 60 | if conf.options.debug: |
Alexander Afanasyev | b82d8c3 | 2017-09-21 11:35:07 -0400 | [diff] [blame] | 61 | extraFlags = conf.flags.getDebugFlags(conf) |
| 62 | if conf.areCustomCxxflagsPresent: |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 63 | missingFlags = [x for x in extraFlags['CXXFLAGS'] if x not in conf.env.CXXFLAGS] |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -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 | 5e1288e | 2014-03-28 11:11:48 -0700 | [diff] [blame] | 68 | else: |
Alexander Afanasyev | b82d8c3 | 2017-09-21 11:35:07 -0400 | [diff] [blame] | 69 | extraFlags = conf.flags.getOptimizedFlags(conf) |
Alexander Afanasyev | 5e1288e | 2014-03-28 11:11:48 -0700 | [diff] [blame] | 70 | |
Alexander Afanasyev | b82d8c3 | 2017-09-21 11:35:07 -0400 | [diff] [blame] | 71 | if not conf.areCustomCxxflagsPresent: |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 72 | conf.add_supported_cxxflags(extraFlags['CXXFLAGS']) |
Davide Pesavento | 7c02b47 | 2015-10-28 20:50:17 +0100 | [diff] [blame] | 73 | conf.add_supported_linkflags(extraFlags['LINKFLAGS']) |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 74 | |
| 75 | conf.env.DEFINES += extraFlags['DEFINES'] |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 76 | |
Alexander Afanasyev | 5e1288e | 2014-03-28 11:11:48 -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 | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 82 | if len(cxxflags) == 0: |
| 83 | return |
| 84 | |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 85 | self.start_msg('Checking supported CXXFLAGS') |
Alexander Afanasyev | 5e1288e | 2014-03-28 11:11:48 -0700 | [diff] [blame] | 86 | |
| 87 | supportedFlags = [] |
Alexander Afanasyev | b82d8c3 | 2017-09-21 11:35:07 -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 | 5e1288e | 2014-03-28 11:11:48 -0700 | [diff] [blame] | 92 | |
Alexander Afanasyev | b78bc4d | 2014-04-09 21:20:52 -0700 | [diff] [blame] | 93 | self.end_msg(' '.join(supportedFlags)) |
Davide Pesavento | 1349d2d | 2016-08-09 06:43:57 +0200 | [diff] [blame] | 94 | self.env.prepend_value('CXXFLAGS', supportedFlags) |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +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 | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 101 | if len(linkflags) == 0: |
| 102 | return |
| 103 | |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 104 | self.start_msg('Checking supported LINKFLAGS') |
| 105 | |
| 106 | supportedFlags = [] |
Alexander Afanasyev | b82d8c3 | 2017-09-21 11:35:07 -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 | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 111 | |
| 112 | self.end_msg(' '.join(supportedFlags)) |
Davide Pesavento | 1349d2d | 2016-08-09 06:43:57 +0200 | [diff] [blame] | 113 | self.env.prepend_value('LINKFLAGS', supportedFlags) |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 114 | |
| 115 | |
| 116 | class CompilerFlags(object): |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 117 | def getCompilerVersion(self, conf): |
| 118 | return tuple(int(i) for i in conf.env.CC_VERSION) |
| 119 | |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 120 | def getGeneralFlags(self, conf): |
Davide Pesavento | 7c02b47 | 2015-10-28 20:50:17 +0100 | [diff] [blame] | 121 | """Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are always needed""" |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 122 | return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': []} |
| 123 | |
| 124 | def getDebugFlags(self, conf): |
Davide Pesavento | 7c02b47 | 2015-10-28 20:50:17 +0100 | [diff] [blame] | 125 | """Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in debug mode""" |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 126 | return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': ['_DEBUG']} |
| 127 | |
| 128 | def getOptimizedFlags(self, conf): |
Davide Pesavento | 7c02b47 | 2015-10-28 20:50:17 +0100 | [diff] [blame] | 129 | """Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in optimized mode""" |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 130 | return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': ['NDEBUG']} |
| 131 | |
| 132 | class GccBasicFlags(CompilerFlags): |
Davide Pesavento | d06ea05 | 2015-10-02 01:48:24 +0200 | [diff] [blame] | 133 | """ |
| 134 | This class defines basic flags that work for both gcc and clang compilers |
| 135 | """ |
Davide Pesavento | 724d65a | 2017-06-23 17:14:08 -0400 | [diff] [blame] | 136 | def getGeneralFlags(self, conf): |
| 137 | flags = super(GccBasicFlags, self).getGeneralFlags(conf) |
Davide Pesavento | 1fd0024 | 2018-05-20 00:11:01 -0400 | [diff] [blame] | 138 | flags['CXXFLAGS'] += ['-std=c++14'] |
Davide Pesavento | 64ae55d | 2018-12-19 00:25:47 -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 | 724d65a | 2017-06-23 17:14:08 -0400 | [diff] [blame] | 143 | return flags |
| 144 | |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 145 | def getDebugFlags(self, conf): |
| 146 | flags = super(GccBasicFlags, self).getDebugFlags(conf) |
Davide Pesavento | 71c622b | 2020-04-24 01:39:01 -0400 | [diff] [blame] | 147 | flags['CXXFLAGS'] += ['-Og', |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 148 | '-g3', |
Davide Pesavento | 7c02b47 | 2015-10-28 20:50:17 +0100 | [diff] [blame] | 149 | '-pedantic', |
| 150 | '-Wall', |
| 151 | '-Wextra', |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 152 | '-Werror', |
Davide Pesavento | 71c622b | 2020-04-24 01:39:01 -0400 | [diff] [blame] | 153 | '-Wcatch-value=2', |
| 154 | '-Wextra-semi', |
Davide Pesavento | 7f20d6e | 2017-01-16 14:43:58 -0500 | [diff] [blame] | 155 | '-Wnon-virtual-dtor', |
Alexander Afanasyev | 465c973 | 2016-10-11 16:35:32 -0700 | [diff] [blame] | 156 | '-Wno-error=deprecated-declarations', # Bug #3795 |
Davide Pesavento | 88a0d81 | 2017-08-19 21:31:42 -0400 | [diff] [blame] | 157 | '-Wno-error=maybe-uninitialized', # Bug #1615 |
| 158 | '-Wno-unused-parameter', |
Davide Pesavento | 1aafba4 | 2015-09-17 17:22:31 -0700 | [diff] [blame] | 159 | ] |
Davide Pesavento | 64ae55d | 2018-12-19 00:25:47 -0500 | [diff] [blame] | 160 | flags['LINKFLAGS'] += ['-Wl,-O1'] |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 161 | return flags |
| 162 | |
| 163 | def getOptimizedFlags(self, conf): |
| 164 | flags = super(GccBasicFlags, self).getOptimizedFlags(conf) |
Davide Pesavento | 7c02b47 | 2015-10-28 20:50:17 +0100 | [diff] [blame] | 165 | flags['CXXFLAGS'] += ['-O2', |
Davide Pesavento | 1aafba4 | 2015-09-17 17:22:31 -0700 | [diff] [blame] | 166 | '-g', |
Davide Pesavento | 7c02b47 | 2015-10-28 20:50:17 +0100 | [diff] [blame] | 167 | '-pedantic', |
| 168 | '-Wall', |
| 169 | '-Wextra', |
Davide Pesavento | 71c622b | 2020-04-24 01:39:01 -0400 | [diff] [blame] | 170 | '-Wcatch-value=2', |
| 171 | '-Wextra-semi', |
Davide Pesavento | 7f20d6e | 2017-01-16 14:43:58 -0500 | [diff] [blame] | 172 | '-Wnon-virtual-dtor', |
Davide Pesavento | 7c02b47 | 2015-10-28 20:50:17 +0100 | [diff] [blame] | 173 | '-Wno-unused-parameter', |
Davide Pesavento | 1aafba4 | 2015-09-17 17:22:31 -0700 | [diff] [blame] | 174 | ] |
Davide Pesavento | 64ae55d | 2018-12-19 00:25:47 -0500 | [diff] [blame] | 175 | flags['LINKFLAGS'] += ['-Wl,-O1'] |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 176 | return flags |
| 177 | |
| 178 | class GccFlags(GccBasicFlags): |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 179 | def getDebugFlags(self, conf): |
| 180 | flags = super(GccFlags, self).getDebugFlags(conf) |
Davide Pesavento | 71c622b | 2020-04-24 01:39:01 -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 |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 186 | return flags |
| 187 | |
Davide Pesavento | d06ea05 | 2015-10-02 01:48:24 +0200 | [diff] [blame] | 188 | def getOptimizedFlags(self, conf): |
| 189 | flags = super(GccFlags, self).getOptimizedFlags(conf) |
Davide Pesavento | 71c622b | 2020-04-24 01:39:01 -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 |
Davide Pesavento | d06ea05 | 2015-10-02 01:48:24 +0200 | [diff] [blame] | 195 | return flags |
| 196 | |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 197 | class ClangFlags(GccBasicFlags): |
| 198 | def getGeneralFlags(self, conf): |
| 199 | flags = super(ClangFlags, self).getGeneralFlags(conf) |
Davide Pesavento | 71c622b | 2020-04-24 01:39:01 -0400 | [diff] [blame] | 200 | if Utils.unversioned_sys_platform() == 'darwin': |
Alexander Afanasyev | 5560fd4 | 2018-03-07 17:03:03 -0500 | [diff] [blame] | 201 | # Bug #4296 |
Alexander Afanasyev | b82d8c3 | 2017-09-21 11:35:07 -0400 | [diff] [blame] | 202 | flags['CXXFLAGS'] += [['-isystem', '/usr/local/include'], # for Homebrew |
| 203 | ['-isystem', '/opt/local/include']] # for MacPorts |
Davide Pesavento | 71c622b | 2020-04-24 01:39:01 -0400 | [diff] [blame] | 204 | elif Utils.unversioned_sys_platform() == 'freebsd': |
| 205 | # Bug #4790 |
| 206 | flags['CXXFLAGS'] += [['-isystem', '/usr/local/include']] |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 207 | return flags |
| 208 | |
| 209 | def getDebugFlags(self, conf): |
| 210 | flags = super(ClangFlags, self).getDebugFlags(conf) |
Davide Pesavento | 1aafba4 | 2015-09-17 17:22:31 -0700 | [diff] [blame] | 211 | flags['CXXFLAGS'] += ['-fcolor-diagnostics', |
Davide Pesavento | 88a0d81 | 2017-08-19 21:31:42 -0400 | [diff] [blame] | 212 | '-Wundefined-func-template', |
Davide Pesavento | 88a0d81 | 2017-08-19 21:31:42 -0400 | [diff] [blame] | 213 | '-Wno-unused-local-typedef', # Bugs #2657 and #3209 |
Davide Pesavento | d06ea05 | 2015-10-02 01:48:24 +0200 | [diff] [blame] | 214 | ] |
Davide Pesavento | 71c622b | 2020-04-24 01:39:01 -0400 | [diff] [blame] | 215 | if self.getCompilerVersion(conf) < (6, 0, 0): |
Davide Pesavento | 52bc4e9 | 2018-08-23 19:08:19 -0400 | [diff] [blame] | 216 | flags['CXXFLAGS'] += ['-Wno-missing-braces'] # Bug #4721 |
Davide Pesavento | d06ea05 | 2015-10-02 01:48:24 +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 | 88a0d81 | 2017-08-19 21:31:42 -0400 | [diff] [blame] | 222 | '-Wundefined-func-template', |
Davide Pesavento | d06ea05 | 2015-10-02 01:48:24 +0200 | [diff] [blame] | 223 | '-Wno-unused-local-typedef', # Bugs #2657 and #3209 |
Davide Pesavento | 1aafba4 | 2015-09-17 17:22:31 -0700 | [diff] [blame] | 224 | ] |
Davide Pesavento | 71c622b | 2020-04-24 01:39:01 -0400 | [diff] [blame] | 225 | if self.getCompilerVersion(conf) < (6, 0, 0): |
Davide Pesavento | 52bc4e9 | 2018-08-23 19:08:19 -0400 | [diff] [blame] | 226 | flags['CXXFLAGS'] += ['-Wno-missing-braces'] # Bug #4721 |
Alexander Afanasyev | 0151579 | 2014-12-16 14:20:01 -0800 | [diff] [blame] | 227 | return flags |