sdl/scons: add option to build with llvm-clang(++)

This commit is contained in:
punkrockguy318 2012-08-12 22:29:00 +00:00
parent 83c4530df2
commit e5b3d6ddd3
1 changed files with 6 additions and 1 deletions

View File

@ -22,8 +22,8 @@ opts.AddVariables(
BoolVariable('LOGO', 'Enable a logoscreen when creating avis (SDL only)', '1'), BoolVariable('LOGO', 'Enable a logoscreen when creating avis (SDL only)', '1'),
BoolVariable('GTK', 'Enable GTK2 GUI (SDL only)', 1), BoolVariable('GTK', 'Enable GTK2 GUI (SDL only)', 1),
BoolVariable('GTK3', 'Enable GTK3 GUI (SDL only)', 0), BoolVariable('GTK3', 'Enable GTK3 GUI (SDL only)', 0),
BoolVariable('CLANG', 'Compile with llvm-clang instead of gcc', 0)
) )
AddOption('--prefix', dest='prefix', type='string', nargs=1, action='store', metavar='DIR', help='installation prefix') AddOption('--prefix', dest='prefix', type='string', nargs=1, action='store', metavar='DIR', help='installation prefix')
prefix = GetOption('prefix') prefix = GetOption('prefix')
@ -60,6 +60,11 @@ if os.environ.has_key('LDFLAGS'):
print "platform: ", env['PLATFORM'] print "platform: ", env['PLATFORM']
# compile with clang
if env['CLANG']:
env.Replace(CC='clang')
env.Replace(CXX='clang++')
# special flags for cygwin # special flags for cygwin
# we have to do this here so that the function and lib checks will go through mingw # we have to do this here so that the function and lib checks will go through mingw
if env['PLATFORM'] == 'cygwin': if env['PLATFORM'] == 'cygwin':