- if Options.options.debug:
- if conf.env['MSVC_COMPILER']:
- conf.env['CFLAGS'] = ['/Od', '/Zi', '/MTd']
- conf.env['CXXFLAGS'] = ['/Od', '/Zi', '/MTd']
- conf.env['LINKFLAGS'] = ['/DEBUG']
- else:
- conf.env['CFLAGS'] = ['-O0', '-g']
- conf.env['CXXFLAGS'] = ['-O0', '-g']
- else:
- if conf.env['MSVC_COMPILER']:
- conf.env['CFLAGS'] = ['/MD']
- conf.env['CXXFLAGS'] = ['/MD']
- append_cxx_flags(['-DNDEBUG'])
-
- if Options.options.ultra_strict:
- Options.options.strict = True
- conf.env.append_value('CFLAGS', ['-Wredundant-decls',
- '-Wstrict-prototypes',
- '-Wmissing-prototypes'])
-
- if Options.options.strict:
- conf.env.append_value('CFLAGS', ['-std=c99', '-pedantic', '-Wshadow'])
- conf.env.append_value('CXXFLAGS', ['-ansi',
- '-Wnon-virtual-dtor',
- '-Woverloaded-virtual'])
- append_cxx_flags(['-Wall',
- '-Wcast-align',
- '-Wextra',
- '-Wwrite-strings'])
- if sys.platform != "darwin":
- # this is really only to be avoid on OLD apple gcc, but not sure how to version check
- append_cxx_flags(['-fstrict-overflow'])
-
- if not conf.check_cc(fragment = '''
-#ifndef __clang__
-#error
-#endif
-int main() { return 0; }''',
- features = 'c',
- mandatory = False,
- execute = False,
- msg = 'Checking for clang'):
- if sys.platform != "darwin":
- # this is really only to be avoid on OLD apple gcc, but not sure how to version check
- append_cxx_flags(['-Wunsafe-loop-optimizations'])
- # this is invalid (still) on Lion apple gcc
- append_cxx_flags(['-Wlogical-op'])
-
-
- if not conf.env['MSVC_COMPILER']:
- append_cxx_flags(['-fshow-column'])
-