- # Remove auto_ptr warnings from libxml++-2.6
- '-Wno-deprecated-declarations',
- '-D_FILE_OFFSET_BITS=64'])
-
- if conf.options.force_cpp11:
- conf.env.append_value('CXXFLAGS', ['-std=c++11', '-DBOOST_NO_CXX11_SCOPED_ENUMS'])
-
- gcc = conf.env['CC_VERSION']
- if int(gcc[0]) >= 4 and int(gcc[1]) > 1:
- conf.env.append_value('CXXFLAGS', ['-Wno-unused-result'])
- have_c11 = int(gcc[0]) >= 4 and int(gcc[1]) >= 8 and int(gcc[2]) >= 1
+ '-Wwrite-strings',
+ '-Wno-error=deprecated',
+ # I tried and failed to ignore these with _Pragma
+ '-Wno-ignored-qualifiers',
+ '-D_FILE_OFFSET_BITS=64',
+ '-std=c++11'])
+
+ if conf.options.disable_more_warnings:
+ # These are for Xcode 15.0.1 with the v2.16.x-era
+ # dependencies; maybe they aren't necessary when building
+ # v2.1{7,8}.x
+ conf.env.append_value('CXXFLAGS', ['-Wno-deprecated-builtins',
+ '-Wno-deprecated-declarations',
+ '-Wno-enum-constexpr-conversion',
+ '-Wno-deprecated-copy'])
+
+ if conf.options.warnings_are_errors:
+ conf.env.append_value('CXXFLAGS', '-Werror')
+
+ if conf.env.SSE:
+ conf.env.append_value('CXXFLAGS', ['-msse', '-mfpmath=sse'])
+
+ if conf.options.enable_asan:
+ conf.env.append_value('CXXFLAGS', '-fsanitize=address')
+ conf.env.append_value('LINKFLAGS', '-fsanitize=address')
+
+ if conf.env['CXX_NAME'] == 'gcc':
+ gcc = conf.env['CC_VERSION']
+ if int(gcc[0]) >= 8:
+ # I tried and failed to ignore these with _Pragma
+ conf.env.append_value('CXXFLAGS', ['-Wno-cast-function-type'])
+ # Most gccs still give these warnings from boost::optional
+ conf.env.append_value('CXXFLAGS', ['-Wno-maybe-uninitialized'])
+ if int(gcc[0]) > 4:
+ # gcc 4.8.5 on Centos 7 does not have this warning
+ conf.env.append_value('CXXFLAGS', ['-Wsuggest-override'])