# -*- mode: python -*- # DOOM build script # TTimo # http://scons.sourceforge.net import scons_utils Import( 'GLOBALS' ) Import( GLOBALS ) idlib_string = ' \ bv/Bounds.cpp \ bv/Frustum.cpp \ bv/Sphere.cpp \ bv/Box.cpp \ containers/HashIndex.cpp \ geometry/DrawVert.cpp \ geometry/Winding2D.cpp \ geometry/Surface_SweptSpline.cpp \ geometry/Winding.cpp \ geometry/Surface.cpp \ geometry/Surface_Patch.cpp \ geometry/TraceModel.cpp \ geometry/JointTransform.cpp \ hashing/CRC32.cpp \ hashing/MD4.cpp \ hashing/MD5.cpp \ math/Angles.cpp \ math/Lcp.cpp \ math/Math.cpp \ math/Matrix.cpp \ math/Ode.cpp \ math/Plane.cpp \ math/Pluecker.cpp \ math/Polynomial.cpp \ math/Quat.cpp \ math/Rotation.cpp \ math/Simd.cpp \ math/Simd_Generic.cpp \ math/Vector.cpp \ Base64.cpp \ BitMsg.cpp \ CmdArgs.cpp \ Dict.cpp \ Heap.cpp \ Image.cpp \ LangDict.cpp \ Lexer.cpp \ Lib.cpp \ MapFile.cpp \ Parser.cpp \ RevisionTracker.cpp \ Str.cpp \ Timer.cpp' # greebo: Compile the token source with less aggressive optimisation, to resolve issue #3184 idlib_noopt_string = ' \ bv/Frustum_gcc.cpp \ Token.cpp' idlib_list = scons_utils.BuildList( 'idlib', idlib_string ) idlib_noopt_list = scons_utils.BuildList( 'idlib', idlib_noopt_string ) for i in range( len( idlib_list ) ): idlib_list[ i ] = '../../' + idlib_list[ i ] for i in range( len( idlib_noopt_list ) ): idlib_noopt_list[ i ] = '../../' + idlib_noopt_list[ i ] local_env = g_env.Clone() # The idlib files use the idlib/precompiled.h header, make sure it's the first to be found local_env.Prepend(CPPPATH = '#/idlib') local_env_noopt = local_env.Clone() # max allowed -O1 flags = OPTCPPFLAGS try: flags.remove( '-O3' ) flags.insert( 0, '-O1' ) except: #print('Warning: Cannot set optimization flags') pass try: local_env_noopt['CPPFLAGS'].remove('-O3') except: print('Error: O3 not found in regular CPPFLAGS, not removing this one.') pass local_env_noopt.Append( CPPFLAGS = flags ) ret_list = [] if ( local_idlibpic == 0 ): for f in idlib_list: ret_list += local_env.StaticObject( source = f ) for f in idlib_noopt_list: ret_list += local_env_noopt.StaticObject( source = f ) else: for f in idlib_list: ret_list += local_env.SharedObject( source = f ) for f in idlib_noopt_list: ret_list += local_env_noopt.SharedObject( source = f ) Return( 'ret_list' )