SConstruct
branchpyrit
changeset 101 50a994a57849
parent 100 c005054bf4c1
child 102 de3e9ea18f56
equal deleted inserted replaced
100:c005054bf4c1 101:50a994a57849
   274 if cc == 'msvc':
   274 if cc == 'msvc':
   275 	sdlenv.Append(LIBS=['SDL', 'SDLmain'])
   275 	sdlenv.Append(LIBS=['SDL', 'SDLmain'])
   276 	sdlenv.Append(LINKFLAGS="/SUBSYSTEM:WINDOWS")
   276 	sdlenv.Append(LINKFLAGS="/SUBSYSTEM:WINDOWS")
   277 else:
   277 else:
   278 	try:
   278 	try:
   279 		sdlenv.ParseConfig('sh sdl-config --cflags')
   279 		sdlenv.ParseConfig('sdl-config --cflags')
   280 		sdlenv.ParseConfig('sh sdl-config --libs')
   280 		sdlenv.ParseConfig('sdl-config --libs')
   281 	except:
   281 	except:
   282 		pass
   282 		pass
   283 
   283 
   284 def CheckSDL(context):
   284 def CheckSDL(context):
   285 	global have_sdl
   285 	global have_sdl
   302 ### build targets
   302 ### build targets
   303 
   303 
   304 Export('env pyenv sdlenv have_sdl cc')
   304 Export('env pyenv sdlenv have_sdl cc')
   305 lib = SConscript('src/SConscript', build_dir='build/lib', duplicate=0,
   305 lib = SConscript('src/SConscript', build_dir='build/lib', duplicate=0,
   306 	exports={'buildmodule':False})
   306 	exports={'buildmodule':False})
   307 (pymodule, modvcproj) = SConscript('src/SConscript', build_dir='build/pymodule', duplicate=0,
   307 if cc == 'msvc':
   308 	exports={'buildmodule':True})
   308 	(pymodule, modvcproj) = SConscript('src/SConscript', build_dir='build/pymodule', duplicate=0,
   309 
   309 		exports={'buildmodule':True})
   310 ccdemvcproj = SConscript('ccdemos/SConscript', build_dir='build/ccdemos', duplicate=0, exports='lib')
   310 	ccdemvcproj = SConscript('ccdemos/SConscript', build_dir='build/ccdemos', duplicate=0, exports='lib')
   311 demosvcproj = SConscript('demos/SConscript', exports='pymodule')
   311 	demosvcproj = SConscript('demos/SConscript', exports='pymodule')
       
   312 else:
       
   313 	pymodule = SConscript('src/SConscript', build_dir='build/pymodule', duplicate=0,
       
   314 		exports={'buildmodule':True})
       
   315 	SConscript('ccdemos/SConscript', build_dir='build/ccdemos', duplicate=0, exports='lib')
       
   316 	SConscript('demos/SConscript', exports='pymodule')
       
   317 
   312 SConscript('tests/SConscript', build_dir='build/tests', duplicate=0, exports='lib')
   318 SConscript('tests/SConscript', build_dir='build/tests', duplicate=0, exports='lib')
   313 SConscript('models/SConscript')
   319 SConscript('models/SConscript')
   314 
   320 
   315 env.Alias('demos', ['cc-demos', 'python-demos'])
   321 env.Alias('demos', ['cc-demos', 'python-demos'])
   316 env.Alias('libs', ['static-lib', 'python-module'])
   322 env.Alias('libs', ['static-lib', 'python-module'])
   320 env.Alias('no-download', ['libs', 'demos', 'local-models'])
   326 env.Alias('no-download', ['libs', 'demos', 'local-models'])
   321 env.Alias('all', ['no-docs', 'docs'])
   327 env.Alias('all', ['no-docs', 'docs'])
   322 env.Alias('pyrit', 'no-download')
   328 env.Alias('pyrit', 'no-download')
   323 Default('pyrit')
   329 Default('pyrit')
   324 
   330 
   325 vcsol = env.MSVSSolution(
   331 if cc == 'msvc':
   326 	target = 'pyrit' + env['MSVSSOLUTIONSUFFIX'],
   332 	vcsol = env.MSVSSolution(
   327 	projects = [modvcproj, ccdemvcproj, demosvcproj],
   333 		target = 'pyrit' + env['MSVSSOLUTIONSUFFIX'],
   328 	variant = 'Release')
   334 		projects = [modvcproj, ccdemvcproj, demosvcproj],
   329 
   335 		variant = 'Release')
   330 env.Depends(vcsol, [modvcproj, ccdemvcproj, demosvcproj]);
   336 
   331 env.Alias('vcproj', vcsol)
   337 	env.Depends(vcsol, [modvcproj, ccdemvcproj, demosvcproj]);
       
   338 	env.Alias('vcproj', vcsol)