SConstruct
branchpyrit
changeset 100 c005054bf4c1
parent 99 f3abdaa2e8fb
child 101 50a994a57849
equal deleted inserted replaced
99:f3abdaa2e8fb 100:c005054bf4c1
    21 
    21 
    22     no-docs = (libs, demos, models)
    22     no-docs = (libs, demos, models)
    23                      - everything but docs
    23                      - everything but docs
    24     no-download = (libs, demos, local-models)
    24     no-download = (libs, demos, local-models)
    25                      - everything but docs and downloadable models
    25                      - everything but docs and downloadable models
       
    26 
       
    27     vcproj           - generate project files for Visual C++ Studio
    26 
    28 
    27 Default target is no-download.
    29 Default target is no-download.
    28 
    30 
    29 Options:
    31 Options:
    30 """)
    32 """)
   233 	print 'Error: Cannot build without pthread.'
   235 	print 'Error: Cannot build without pthread.'
   234 	Exit(1)
   236 	Exit(1)
   235 
   237 
   236 
   238 
   237 # configure libpng
   239 # configure libpng
   238 if conf.CheckLibWithHeader('zlib', 'zlib.h', 'C') and conf.CheckLibWithHeader('libpng', 'png.h', 'C'):
   240 conf.CheckLibWithHeader('zlib', 'zlib.h', 'C')
       
   241 if conf.CheckLibWithHeader('libpng', 'png.h', 'C'):
   239 	conf.Define('HAVE_PNG')
   242 	conf.Define('HAVE_PNG')
   240 
   243 
   241 env = conf.Finish()
   244 env = conf.Finish()
   242 
   245 
   243 
   246 
   299 ### build targets
   302 ### build targets
   300 
   303 
   301 Export('env pyenv sdlenv have_sdl cc')
   304 Export('env pyenv sdlenv have_sdl cc')
   302 lib = SConscript('src/SConscript', build_dir='build/lib', duplicate=0,
   305 lib = SConscript('src/SConscript', build_dir='build/lib', duplicate=0,
   303 	exports={'buildmodule':False})
   306 	exports={'buildmodule':False})
   304 pymodule = SConscript('src/SConscript', build_dir='build/pymodule', duplicate=0,
   307 (pymodule, modvcproj) = SConscript('src/SConscript', build_dir='build/pymodule', duplicate=0,
   305 	exports={'buildmodule':True})
   308 	exports={'buildmodule':True})
   306 
   309 
   307 SConscript('ccdemos/SConscript', build_dir='build/ccdemos', duplicate=0, exports='lib')
   310 ccdemvcproj = SConscript('ccdemos/SConscript', build_dir='build/ccdemos', duplicate=0, exports='lib')
   308 SConscript('demos/SConscript', exports='pymodule')
   311 demosvcproj = SConscript('demos/SConscript', exports='pymodule')
   309 SConscript('tests/SConscript', build_dir='build/tests', duplicate=0, exports='lib')
   312 SConscript('tests/SConscript', build_dir='build/tests', duplicate=0, exports='lib')
   310 SConscript('models/SConscript')
   313 SConscript('models/SConscript')
   311 
   314 
   312 env.Alias('demos', ['cc-demos', 'python-demos'])
   315 env.Alias('demos', ['cc-demos', 'python-demos'])
   313 env.Alias('libs', ['static-lib', 'python-module'])
   316 env.Alias('libs', ['static-lib', 'python-module'])
   316 env.Alias('no-docs', ['libs', 'demos', 'models'])
   319 env.Alias('no-docs', ['libs', 'demos', 'models'])
   317 env.Alias('no-download', ['libs', 'demos', 'local-models'])
   320 env.Alias('no-download', ['libs', 'demos', 'local-models'])
   318 env.Alias('all', ['no-docs', 'docs'])
   321 env.Alias('all', ['no-docs', 'docs'])
   319 env.Alias('pyrit', 'no-download')
   322 env.Alias('pyrit', 'no-download')
   320 Default('pyrit')
   323 Default('pyrit')
       
   324 
       
   325 vcsol = env.MSVSSolution(
       
   326 	target = 'pyrit' + env['MSVSSOLUTIONSUFFIX'],
       
   327 	projects = [modvcproj, ccdemvcproj, demosvcproj],
       
   328 	variant = 'Release')
       
   329 
       
   330 env.Depends(vcsol, [modvcproj, ccdemvcproj, demosvcproj]);
       
   331 env.Alias('vcproj', vcsol)