From e5b3d6ddd31547dadf07e523f1952fe638bf86d0 Mon Sep 17 00:00:00 2001 From: punkrockguy318 Date: Sun, 12 Aug 2012 22:29:00 +0000 Subject: [PATCH] sdl/scons: add option to build with llvm-clang(++) --- SConstruct | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index aef2435f..e3fda430 100644 --- a/SConstruct +++ b/SConstruct @@ -22,8 +22,8 @@ opts.AddVariables( BoolVariable('LOGO', 'Enable a logoscreen when creating avis (SDL only)', '1'), BoolVariable('GTK', 'Enable GTK2 GUI (SDL only)', 1), 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') prefix = GetOption('prefix') @@ -60,6 +60,11 @@ if os.environ.has_key('LDFLAGS'): print "platform: ", env['PLATFORM'] +# compile with clang +if env['CLANG']: + env.Replace(CC='clang') + env.Replace(CXX='clang++') + # special flags for cygwin # we have to do this here so that the function and lib checks will go through mingw if env['PLATFORM'] == 'cygwin':