[Cppunit-cvs] cppunit2 sconstruct,1.6,1.7
Brought to you by:
blep
From: Baptiste L. <bl...@us...> - 2005-03-04 08:24:06
|
Update of /cvsroot/cppunit/cppunit2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20052 Modified Files: sconstruct Log Message: * added buildLibrary() and buildLibraryUnitTest() exported functions to sconstruct * refactored sconscript to use the exported functions * build productions are now placed in a platform specific subdirectory (bin/mingw/...) Index: sconstruct =================================================================== RCS file: /cvsroot/cppunit/cppunit2/sconstruct,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sconstruct 1 Mar 2005 22:16:30 -0000 1.6 --- sconstruct 4 Mar 2005 08:23:39 -0000 1.7 *************** *** 2,55 **** import os.path # Ensure build directory exist (SConsignFile fail otherwise!) ! if not os.path.exists( Dir('#buildscons').abspath ): ! os.mkdir( Dir('#buildscons').abspath ) # Store all dependencies signature in a database - sconsign_path = os.path.join( Dir('#buildscons').abspath, '.sconsign.dbm' ) SConsignFile( sconsign_path ) ! platform = 'mingw' ! ! if platform == 'sun': env = Environment( ENV = {'PATH' : os.environ['PATH']}, CPPPATH = '#include', LIBPATH = '#libs', tools=['default','suncc'] ) ! elif platform == 'aix': env = Environment( ENV = {'PATH' : os.environ['PATH']}, CCFLAGS = '-qrtti=all', - CPPPATH = '#include', - LIBPATH = '#libs', tools=['default','aixcc'], CXX ='xlC_r', LINKFLAGS='-bh:5' ) # -bh:5 remove duplicate symbol warning elif platform == 'msvc': ! env = Environment( CCFLAGS = '-GX -GR -nologo', ! CPPPATH = '#include', ! LIBPATH = '#libs' ) elif platform == 'mingw': ! env = Environment( CPPPATH = '#include', ! LIBPATH = '#libs', ! tools=['default','mingw'] ) env_testing = env.Copy( LIBS = ['cpput','opentest'] ) ! ! def buildCppUnitExample( env, taget_sources, target_name ): exe = env.Program( target=target_name, ! source=taget_sources ) ! bin_dir='#bin' env.Install( bin_dir, exe ) ! Export( 'env env_testing buildCppUnitExample' ) ! SConscript( 'src/cpput/SConscript', build_dir='#buildscons/cpput', duplicate=0 ) ! SConscript( 'src/opentest/SConscript', build_dir='#buildscons/opentest', duplicate=0 ) ! SConscript( 'src/cpputtest/SConscript', build_dir='#buildscons/cpputtest', duplicate=0 ) ! SConscript( 'examples/input_based_test/SConscript', build_dir='#buildscons/examples/input_based_test', duplicate=0 ) ! SConscript( 'examples/parametrized_test/SConscript', build_dir='#buildscons/examples/parametrized_test', duplicate=0 ) ! SConscript( 'examples/checking_assertions/SConscript', build_dir='#buildscons/examples/checking_assertions', duplicate=0 ) ! \ No newline at end of file --- 2,68 ---- import os.path + platform = 'mingw' + + build_dir = os.path.join( '#buildscons', platform ) + bin_dir = os.path.join( '#bin', platform ) + lib_dir = os.path.join( '#libs', platform ) + sconsign_dir_path = Dir(build_dir).abspath + sconsign_path = os.path.join( sconsign_dir_path, '.sconsign.dbm' ) + # Ensure build directory exist (SConsignFile fail otherwise!) ! if not os.path.exists( sconsign_dir_path ): ! os.makedirs( sconsign_dir_path ) # Store all dependencies signature in a database SConsignFile( sconsign_path ) ! if platform == 'suncc': env = Environment( ENV = {'PATH' : os.environ['PATH']}, CPPPATH = '#include', LIBPATH = '#libs', tools=['default','suncc'] ) ! elif platform == 'vacpp': env = Environment( ENV = {'PATH' : os.environ['PATH']}, CCFLAGS = '-qrtti=all', tools=['default','aixcc'], CXX ='xlC_r', LINKFLAGS='-bh:5' ) # -bh:5 remove duplicate symbol warning elif platform == 'msvc': ! env = Environment( CCFLAGS = '-GX -GR -nologo' ) elif platform == 'mingw': ! env = Environment( tools=['default','mingw'] ) + env.Append( CPPPATH = '#include', + LIBPATH = lib_dir ) + env_testing = env.Copy( LIBS = ['cpput','opentest'] ) ! def buildCppUnitExample( env, target_sources, target_name ): exe = env.Program( target=target_name, ! source=target_sources ) ! global bin_dir env.Install( bin_dir, exe ) ! def buildLibary( env, target_sources, target_name ): ! static_lib = env.StaticLibrary( target=target_name, ! source=target_sources ) ! global lib_dir ! env.Install( lib_dir, static_lib ) ! def buildLibraryUnitTest( env, target_sources, target_name ): ! buildCppUnitExample( env, target_sources, target_name ) + Export( 'env env_testing buildCppUnitExample buildLibary buildLibraryUnitTest' ) ! def buildProjectInDirectory( target_directory ): ! global build_dir ! target_build_dir = os.path.join( build_dir, target_directory ) ! target = os.path.join( target_directory, 'SConscript' ) ! SConscript( target, build_dir=target_build_dir, duplicate=0 ) ! ! buildProjectInDirectory( 'src/cpput' ) ! buildProjectInDirectory( 'src/opentest' ) ! buildProjectInDirectory( 'src/cpputtest' ) ! buildProjectInDirectory( 'examples/input_based_test' ) ! buildProjectInDirectory( 'examples/parametrized_test' ) ! buildProjectInDirectory( 'examples/checking_assertions' ) |