Merge pull request #26354 from ksooo/pvr-fix-listitem-titleextrainfo
[xbmc.git] / lib / libUPnP / Platinum / Build / Tools / SCons / gcc-generic.py
bloba3e3a1bd2aca5fb0e424f2e89f82a382f510bd89
1 import os
3 def generate(env, gcc_cross_prefix=None, gcc_strict=True, gcc_stop_on_warning=None, gcc_extra_options=''):
4 if gcc_stop_on_warning == None: gcc_stop_on_warning = env['stop_on_warning']
6 ### compiler flags
7 if gcc_strict:
8 env.AppendUnique(CCFLAGS = ['-pedantic', '-Wall', '-W', '-Wundef', '-Wno-long-long'])
9 env.AppendUnique(CFLAGS = ['-Wmissing-prototypes', '-Wmissing-declarations'])
10 else:
11 env.AppendUnique(CCFLAGS = ['-Wall'])
13 compiler_defines = ['-D_REENTRANT']
14 env.AppendUnique(CCFLAGS = compiler_defines)
15 env.AppendUnique(CPPFLAGS = compiler_defines)
17 if env['build_config'] == 'Debug':
18 env.AppendUnique(CCFLAGS = '-g')
19 else:
20 env.AppendUnique(CCFLAGS = '-O3')
22 if gcc_stop_on_warning:
23 env.AppendUnique(CCFLAGS = ['-Werror'])
25 env['STRIP'] = 'strip'
27 if gcc_cross_prefix:
28 env['ENV']['PATH'] += os.environ['PATH']
29 env['AR'] = gcc_cross_prefix+'-ar'
30 env['RANLIB'] = gcc_cross_prefix+'-ranlib'
31 env['CC'] = gcc_cross_prefix+'-gcc ' + gcc_extra_options
32 env['CXX'] = gcc_cross_prefix+'-g++ ' + gcc_extra_options
33 env['LINK'] = gcc_cross_prefix+'-g++ ' + gcc_extra_options
34 env['STRIP'] = gcc_cross_prefix+'-strip'