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