# HG changeset patch # User Radek Brich # Date 1250666309 -7200 # Node ID 50a994a57849622e5f4557a144835fe115fca885 # Parent c005054bf4c11dcc03a5d2d258eb73400c3c8ef4 vcproj build target only for cc=msvc, fix sdl-config diff -r c005054bf4c1 -r 50a994a57849 SConstruct --- a/SConstruct Sun May 31 23:06:03 2009 +0200 +++ b/SConstruct Wed Aug 19 09:18:29 2009 +0200 @@ -276,8 +276,8 @@ sdlenv.Append(LINKFLAGS="/SUBSYSTEM:WINDOWS") else: try: - sdlenv.ParseConfig('sh sdl-config --cflags') - sdlenv.ParseConfig('sh sdl-config --libs') + sdlenv.ParseConfig('sdl-config --cflags') + sdlenv.ParseConfig('sdl-config --libs') except: pass @@ -304,11 +304,17 @@ Export('env pyenv sdlenv have_sdl cc') lib = SConscript('src/SConscript', build_dir='build/lib', duplicate=0, exports={'buildmodule':False}) -(pymodule, modvcproj) = SConscript('src/SConscript', build_dir='build/pymodule', duplicate=0, - exports={'buildmodule':True}) +if cc == 'msvc': + (pymodule, modvcproj) = SConscript('src/SConscript', build_dir='build/pymodule', duplicate=0, + exports={'buildmodule':True}) + ccdemvcproj = SConscript('ccdemos/SConscript', build_dir='build/ccdemos', duplicate=0, exports='lib') + demosvcproj = SConscript('demos/SConscript', exports='pymodule') +else: + pymodule = SConscript('src/SConscript', build_dir='build/pymodule', duplicate=0, + exports={'buildmodule':True}) + SConscript('ccdemos/SConscript', build_dir='build/ccdemos', duplicate=0, exports='lib') + SConscript('demos/SConscript', exports='pymodule') -ccdemvcproj = SConscript('ccdemos/SConscript', build_dir='build/ccdemos', duplicate=0, exports='lib') -demosvcproj = SConscript('demos/SConscript', exports='pymodule') SConscript('tests/SConscript', build_dir='build/tests', duplicate=0, exports='lib') SConscript('models/SConscript') @@ -322,10 +328,11 @@ env.Alias('pyrit', 'no-download') Default('pyrit') -vcsol = env.MSVSSolution( - target = 'pyrit' + env['MSVSSOLUTIONSUFFIX'], - projects = [modvcproj, ccdemvcproj, demosvcproj], - variant = 'Release') +if cc == 'msvc': + vcsol = env.MSVSSolution( + target = 'pyrit' + env['MSVSSOLUTIONSUFFIX'], + projects = [modvcproj, ccdemvcproj, demosvcproj], + variant = 'Release') -env.Depends(vcsol, [modvcproj, ccdemvcproj, demosvcproj]); -env.Alias('vcproj', vcsol) + env.Depends(vcsol, [modvcproj, ccdemvcproj, demosvcproj]); + env.Alias('vcproj', vcsol) diff -r c005054bf4c1 -r 50a994a57849 ccdemos/SConscript --- a/ccdemos/SConscript Sun May 31 23:06:03 2009 +0200 +++ b/ccdemos/SConscript Wed Aug 19 09:18:29 2009 +0200 @@ -1,4 +1,4 @@ -Import('env sdlenv have_sdl lib') +Import('env sdlenv have_sdl lib cc') myenv = sdlenv.Clone() myenv.Append(LIBPATH=['#build/lib']) myenv.Prepend(LIBS=['pyrit']) @@ -16,19 +16,20 @@ env.Alias('cc-demos', l) -# MS Visual Studio Project -vcprojsrcs = [] -for src in demos: - vcprojsrcs += ['ccdemos/' + src] -vcprojincs = [] -for inc in includes: - vcprojincs += ['ccdemos/' + inc] -vcproj = env.MSVSProject( - auto_build_solution=0, - target = '#pyrit_ccdemos' + env['MSVSPROJECTSUFFIX'], - srcs = vcprojsrcs, - incs = vcprojincs, - buildtarget = 'cc-demos', - variant = 'Release') +if cc == 'msvc': + # MS Visual Studio Project + vcprojsrcs = [] + for src in demos: + vcprojsrcs += ['ccdemos/' + src] + vcprojincs = [] + for inc in includes: + vcprojincs += ['ccdemos/' + inc] + vcproj = env.MSVSProject( + auto_build_solution=0, + target = '#pyrit_ccdemos' + env['MSVSPROJECTSUFFIX'], + srcs = vcprojsrcs, + incs = vcprojincs, + buildtarget = 'cc-demos', + variant = 'Release') -Return('vcproj') + Return('vcproj') diff -r c005054bf4c1 -r 50a994a57849 demos/SConscript --- a/demos/SConscript Sun May 31 23:06:03 2009 +0200 +++ b/demos/SConscript Wed Aug 19 09:18:29 2009 +0200 @@ -1,4 +1,4 @@ -Import('pymodule') +Import('pymodule cc') env = Environment() env.Append(BUILDERS = {'Copy':Builder(action=Copy('$TARGET','$SOURCE'), single_source=True)}) @@ -19,15 +19,16 @@ env.Alias('python-demos', l) -# MS Visual Studio Project -vcprojmisc = [] -for file in files: - vcprojmisc += ['demos/' + file] -vcproj = env.MSVSProject( - auto_build_solution=0, - target = '#pyrit_demos' + env['MSVSPROJECTSUFFIX'], - misc = vcprojmisc, - buildtarget = 'python-demos', - variant = 'Release') +if cc == 'msvc': + # MS Visual Studio Project + vcprojmisc = [] + for file in files: + vcprojmisc += ['demos/' + file] + vcproj = env.MSVSProject( + auto_build_solution=0, + target = '#pyrit_demos' + env['MSVSPROJECTSUFFIX'], + misc = vcprojmisc, + buildtarget = 'python-demos', + variant = 'Release') -Return('vcproj') + Return('vcproj') diff -r c005054bf4c1 -r 50a994a57849 src/SConscript --- a/src/SConscript Sun May 31 23:06:03 2009 +0200 +++ b/src/SConscript Wed Aug 19 09:18:29 2009 +0200 @@ -33,22 +33,24 @@ env.Alias('shared-objs', shared_objs) env.Alias('python-module', pymodule) - # MS Visual Studio Project - vcprojsrcs = [] - for src in sources+['raytracermodule.cc']: - vcprojsrcs += ['src/' + src] - vcprojincs = [] - for inc in includes: - vcprojincs += ['include/' + inc] - vcproj = env.MSVSProject( - auto_build_solution=0, - target = '#pyrit_module' + env['MSVSPROJECTSUFFIX'], - srcs = vcprojsrcs, - incs = vcprojincs, - buildtarget = 'python-module', - variant = 'Release') + if cc == 'msvc': + # MS Visual Studio Project + vcprojsrcs = [] + for src in sources+['raytracermodule.cc']: + vcprojsrcs += ['src/' + src] + vcprojincs = [] + for inc in includes: + vcprojincs += ['include/' + inc] + vcproj = env.MSVSProject( + auto_build_solution=0, + target = '#pyrit_module' + env['MSVSPROJECTSUFFIX'], + srcs = vcprojsrcs, + incs = vcprojincs, + buildtarget = 'python-module', + variant = 'Release') + Return(('pymodule', 'vcproj')) - Return(('pymodule', 'vcproj')) + Return('pymodule') else: objs = [] for src in sources: