Thread: [Cppunit-cvs] cppunit2/src/cpput SConscript,1.2,1.3
Brought to you by:
blep
From: Baptiste L. <bl...@us...> - 2005-02-23 23:11:18
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29968/src/cpput Modified Files: SConscript Log Message: * scons can be used to build cppunit 2 using mingw Index: SConscript =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/SConscript,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SConscript 14 Jun 2004 23:30:12 -0000 1.2 --- SConscript 23 Feb 2005 23:10:58 -0000 1.3 *************** *** 1,162 **** ! # cpput lib build script ! import os.path ! ! ##Release: ! ##/O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_LIB" /D "_MBCS" ! ##/FD /EHsc /MT /GR /YX"stdafx.h" ! ##/Fp".\..\..\build\cpput\release/cpput.pch" ! ##/Fo".\..\..\build\cpput\release/" ! ##/Fd".\..\..\build\cpput\release/" /W3 /nologo /c ! ! ##/EHa : enable exception (any instructions can throw an exception) ! ##/MT: multithreaded ! ##/MTd: mutlithread & debug ! ##/MD: multithreaded dll ! ##/MDd: multithreaded dll & debug ! ##/ML: singlethreaded ! ##/MLd: singlethreaded & debug ! ##/GR: enable rtti (_CPPRTTI is defined) ! ##/GF: enable string-pooling as read-only ! ##/W3: warning level 3 ! ##/nologo: disable copyright message ! ##/Zi: produce PDB debug information ! ##/Oi: enable intrinsic function optimization ! ##/Za: disable language extension (compile in C++ conformant mode) ! ! ##/Fd: PDB filename (link?) ! ##/Gy: enable function level linking ! ! ##Debug: ! ##/Od: disable optimization ! ##/RTCc: smaller type check ! ##/RTC1: stack frame & uninitialized variable check ! ##/GS: buffer security check ! ! # variant options: ! # crtdll ! # nothread, threaded ! # release,debug ! # exception, noexception ! # rtti, nortti ! # ansi, extension ! # stl, stlport ! ! # crt/rtti ! ! class BadBuildFeatures(RuntimeError): ! def __init__( self, message ): ! RuntimeError.__init__( message ) ! ! class FeatureValidator: ! def validate( self, features ): ! pass ! ! def checkIncompatibility( self, features, feature_set, incompatible_feature_set ): ! feature_set = self._getActualFeatures( feature_set ) ! incompatible_feature_set = self._getActualFeatures( incompatible_feature_set ) ! for feature in feature_set: ! if feature in incompatible_feature_set: ! self.reportIncompatibleFeatures( feature_set, incompatible_feature_set ) ! ! def _getActualFeatures( self, wanted_features, actual_features ): ! if type(wanted_features) is str: ! wanted_features = [ wanted_features ] ! return filter( lambda feature: feature in actual_features ) ! ! def reportIncompatibleFeatures( self, features1, features2 ): ! raise BadBuildFeatures( 'Feature <%s> can not be used with %s.' % (','.join(feature1s),','.join(feature2)) ) ! ! class CRTFeatureValidator(FeatureValidator): ! def validate( self, features ): ! self.checkIncompatibility( features, 'crtldll thread'.split(), 'nothread' ) ! self.checkIncompatibility( features, 'release', 'debug' ) ! ! class OptionsFeatureValidator(CRTFeatureValidator): ! def validate( self, features ): ! CRTFeatureValidator.validate( self, features ) ! self.checkIncompatibility( 'rtti', 'nortti' ) ! self.checkIncompatibility( 'exception', 'noexception' ) ! self.checkIncompatibility( 'ansi', 'extension' ) ! ! msvc71_compiler_options = [ ! '__default__ : /W3 /nologo /GF', ! 'crtdll release : /MD', ! 'crtdll debug : /MDd', ! 'threaded release : /MT', ! 'threaded debug : MTd', ! 'nothread release : /ML', ! 'nothread debug : MLd', ! 'rtti : /GR', ! 'exception : /EHa', ! 'noexception : /GX-', ! 'ansi : /Za', ! 'extension : /Ze', ! 'release : /O2 /Oi', ! 'debug : /Od' ] ! ! preprocessor_options = [ ! '__default__ : win32', ! 'release : NDEBUG', ! 'debug : _DEBUG' ] ! ! def getCompilerOptions( features, options_map ): ! all_compiler_options = [] ! for option in options_map: ! splitted = option.split(':') ! option_features = splitted[0].split() ! compiler_options = splitted[1].strip() ! has_option_features = True ! for feature in option_features: ! if feature not in features: ! has_option_features = False ! break ! if has_option_features: ! all_compiler_options.append( compiler_options ) ! return ' '.join( all_compiler_options ) ! ! ! Import( 'base_env' ) ! env = base_env.Copy() ! ! ! class FilterTargetByExt: ! def __init__( self, ext ): ! self.ext = ext ! def __call__( self, target ): ! import os ! return os.path.splitext( str(target) )[1] == self.ext ! ! def FindDllNodeInNodes( targets ): ! return ! cpput_sources=""" ! assert.cpp ! assertstring.cpp ! atomiccounter.cpp ! registry.cpp ! testcase.cpp ! testcontext.cpp ! testfailureguard.cpp ! testsuite.cpp thread.cpp ! """ ! ! BuildDir ('#buildscons/cpput/static', '#src/cpput', duplicate=0) ! ! def prefix_list( list, prefix ): ! return map( lambda item: os.path.join( prefix, item ), list ) ! ! cpput_sources = prefix_list( Split(cpput_sources), '#buildscons/cpput/static' ) ! #print '\n'.join(cpput_sources) ! static_lib = env.StaticLibrary( target='cpput-vc6-rs', source=cpput_sources ) ! #BuildDir('#build/cpput/dll', '#src/cpput', duplicate=0) ! #env.Append( CCFLAGS=' -DCPPUT_DLL_BUILD' ) ! #shared_lib = env.SharedLibrary( target='cpput-vc6-rd', ! # source=Split(cpput_sources) ) libs_dir='#libs' --- 1,25 ---- ! Import( 'env' ) + env = env.Copy( LIBPATH = '#libs' ) cpput_sources=""" ! assert.cpp ! assertstring.cpp ! exceptionguard.cpp ! properties.cpp ! registry.cpp ! testcase.cpp ! testinfo.cpp ! testrunner.cpp ! testsuite.cpp thread.cpp ! """.split() ! static_lib = env.StaticLibrary( target='cpput', source=cpput_sources ) ! ! #shared_lib = env.SharedLibrary( target='cpput', ! # source=cpput_sources ) libs_dir='#libs' *************** *** 164,167 **** env.Install( libs_dir, static_lib ) - #env.Install( libs_dir, filter( FilterTargetByExt('.lib'), shared_lib ) ) - #env.Install( bin_dir, filter( FilterTargetByExt('.dll'), shared_lib ) ) --- 27,28 ---- |