SConscript (11548:91f58918a76a) SConscript (11718:09f8fda798bc)
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2005 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 1071 unchanged lines hidden (view full) ---

1080 # warnings about uninitialized variables and missing field
1081 # initializers.
1082 swig_env.Append(CCFLAGS=['-Wno-uninitialized',
1083 '-Wno-missing-field-initializers',
1084 '-Wno-unused-but-set-variable',
1085 '-Wno-maybe-uninitialized',
1086 '-Wno-type-limits'])
1087
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2005 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 1071 unchanged lines hidden (view full) ---

1080 # warnings about uninitialized variables and missing field
1081 # initializers.
1082 swig_env.Append(CCFLAGS=['-Wno-uninitialized',
1083 '-Wno-missing-field-initializers',
1084 '-Wno-unused-but-set-variable',
1085 '-Wno-maybe-uninitialized',
1086 '-Wno-type-limits'])
1087
1088
1089 # The address sanitizer is available for gcc >= 4.8
1090 if GetOption('with_asan'):
1091 if GetOption('with_ubsan') and \
1092 compareVersions(env['GCC_VERSION'], '4.9') >= 0:
1093 new_env.Append(CCFLAGS=['-fsanitize=address,undefined',
1094 '-fno-omit-frame-pointer'])
1095 new_env.Append(LINKFLAGS='-fsanitize=address,undefined')
1096 else:
1097 new_env.Append(CCFLAGS=['-fsanitize=address',
1098 '-fno-omit-frame-pointer'])
1099 new_env.Append(LINKFLAGS='-fsanitize=address')
1088 # Only gcc >= 4.9 supports UBSan, so check both the version
1089 # and the command-line option before adding the compiler and
1090 # linker flags.
1100 # Only gcc >= 4.9 supports UBSan, so check both the version
1101 # and the command-line option before adding the compiler and
1102 # linker flags.
1091 if GetOption('with_ubsan') and \
1103 elif GetOption('with_ubsan') and \
1092 compareVersions(env['GCC_VERSION'], '4.9') >= 0:
1093 new_env.Append(CCFLAGS='-fsanitize=undefined')
1094 new_env.Append(LINKFLAGS='-fsanitize=undefined')
1095
1104 compareVersions(env['GCC_VERSION'], '4.9') >= 0:
1105 new_env.Append(CCFLAGS='-fsanitize=undefined')
1106 new_env.Append(LINKFLAGS='-fsanitize=undefined')
1107
1096 # The address sanitizer is available for gcc >= 4.8
1097 if GetOption('with_asan'):
1098 new_env.Append(CCFLAGS=['-fsanitize=address',
1099 '-fno-omit-frame-pointer'])
1100 new_env.Append(LINKFLAGS='-fsanitize=address')
1101
1102 if env['CLANG']:
1103 swig_env.Append(CCFLAGS=['-Wno-sometimes-uninitialized',
1104 '-Wno-deprecated-register',
1105 '-Wno-tautological-compare'])
1106
1107 # We require clang >= 3.1, so there is no need to check any
1108 # versions here.
1109 if GetOption('with_ubsan'):
1108
1109 if env['CLANG']:
1110 swig_env.Append(CCFLAGS=['-Wno-sometimes-uninitialized',
1111 '-Wno-deprecated-register',
1112 '-Wno-tautological-compare'])
1113
1114 # We require clang >= 3.1, so there is no need to check any
1115 # versions here.
1116 if GetOption('with_ubsan'):
1110 new_env.Append(CCFLAGS='-fsanitize=undefined')
1111 new_env.Append(LINKFLAGS='-fsanitize=undefined')
1117 if GetOption('with_asan'):
1118 new_env.Append(CCFLAGS=['-fsanitize=address,undefined',
1119 '-fno-omit-frame-pointer'])
1120 new_env.Append(LINKFLAGS='-fsanitize=address,undefined')
1121 else:
1122 new_env.Append(CCFLAGS='-fsanitize=undefined')
1123 new_env.Append(LINKFLAGS='-fsanitize=undefined')
1112
1124
1113 if GetOption('with_asan'):
1125 elif GetOption('with_asan'):
1114 new_env.Append(CCFLAGS=['-fsanitize=address',
1115 '-fno-omit-frame-pointer'])
1116 new_env.Append(LINKFLAGS='-fsanitize=address')
1117
1118 werror_env = new_env.Clone()
1119 # Treat warnings as errors but white list some warnings that we
1120 # want to allow (e.g., deprecation warnings).
1121 werror_env.Append(CCFLAGS=['-Werror',

--- 216 unchanged lines hidden ---
1126 new_env.Append(CCFLAGS=['-fsanitize=address',
1127 '-fno-omit-frame-pointer'])
1128 new_env.Append(LINKFLAGS='-fsanitize=address')
1129
1130 werror_env = new_env.Clone()
1131 # Treat warnings as errors but white list some warnings that we
1132 # want to allow (e.g., deprecation warnings).
1133 werror_env.Append(CCFLAGS=['-Werror',

--- 216 unchanged lines hidden ---