From 3bb82a27fc61b787ab83145f9a7962c14e7ca769 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sat, 4 Feb 2006 14:15:10 +0000 Subject: == SCons == * This commit is all of the rewrite work done on the SCons system. For documentation see doc/blender-scons.txt and doc/blender-scons-dev.txt. Also http://mediawiki.blender.org/index.php/BlenderDev/SconsRefactoring contains valuable information, along with what still needs to be done. - linux, os x and windows compile now. - files are compiled to BF_INSTALLDIR (see config/(platform)-config.py) - NOTE: Jean-Luc P will commit sometime during the weekend proper appit() for OS X. For now, copy the resulting binary to an existing .app bundle. - features: - cleaner structure for better maintenance - cleaner output during compile - better handling of build options - general overall speed increase - see the wiki for more info Cygwin, FreeBSD and Solaris systems still need work. For these systems: 1) copy a config/(platform)-config.py to ie. config/cygwin-config.py 2) set the proper defaults for your platform 3) mail me at jesterking at letwory dot net with you configuration. if you need any modifications to the system, do send a patch, too. I'll be giving first-aid today and tomorrow, after that it'll be all regular development work :) /Nathan --- source/blender/SConscript | 12 +- source/blender/avi/SConscript | 24 +-- source/blender/blenkernel/SConscript | 95 +++------- .../blenkernel/bad_level_call_stubs/SConscript | 33 +--- source/blender/blenlib/SConscript | 52 +----- source/blender/blenloader/SConscript | 31 +--- source/blender/blenpluginapi/SConscript | 21 +-- source/blender/ftfont/SConscript | 30 ++- source/blender/imbuf/SConscript | 67 ++----- source/blender/imbuf/intern/openexr/SConscript | 29 ++- source/blender/img/SConscript | 17 +- source/blender/makesdna/SConscript | 9 +- source/blender/makesdna/intern/SConscript | 32 ++-- source/blender/python/SConscript | 89 ++------- source/blender/quicktime/SConscript | 36 ++-- source/blender/radiosity/SConscript | 28 +-- source/blender/readblenfile/SConscript | 20 +- source/blender/render/SConscript | 43 ++--- source/blender/src/SConscript | 201 +++------------------ source/blender/yafray/SConscript | 23 +-- 20 files changed, 223 insertions(+), 669 deletions(-) (limited to 'source/blender') diff --git a/source/blender/SConscript b/source/blender/SConscript index 926dc75e7ea..ba821355e23 100644 --- a/source/blender/SConscript +++ b/source/blender/SConscript @@ -1,5 +1,5 @@ #!/usr/bin/python -Import ('user_options_dict') +Import ('env') SConscript(['avi/SConscript', 'blenkernel/SConscript', @@ -16,11 +16,11 @@ SConscript(['avi/SConscript', 'src/SConscript', 'yafray/SConscript']) -if user_options_dict['USE_OPENEXR'] == 1: - SConscript (['imbuf/intern/openexr/SConscript']) - -if user_options_dict['USE_INTERNATIONAL'] == 1: +if env['WITH_BF_FREETYPE'] == 1: SConscript (['ftfont/SConscript']) -if user_options_dict['USE_QUICKTIME'] == 1: +if env['WITH_BF_OPENEXR'] == 1: + SConscript (['imbuf/intern/openexr/SConscript']) + +if env['WITH_BF_QUICKTIME'] == 1: SConscript (['quicktime/SConscript']) diff --git a/source/blender/avi/SConscript b/source/blender/avi/SConscript index 56eaff26f0f..6c2faa5329d 100644 --- a/source/blender/avi/SConscript +++ b/source/blender/avi/SConscript @@ -1,22 +1,10 @@ #!/usr/bin/python -Import ('extra_includes') -Import ('user_options_dict') -Import ('library_env') +#Import ('extra_includes') +Import ('env') -avi_env = library_env.Copy () +sources = env.Glob('intern/*.c') -source_files = ['intern/avi.c', - 'intern/avirgb.c', - 'intern/codecs.c', - 'intern/endian.c', - 'intern/mjpeg.c', - 'intern/options.c', - 'intern/rgb32.c'] +incs = '. #/intern/guardedalloc' +incs += ' ' + env['BF_JPEG_INC'] -avi_env.Append (CPPPATH = ['.', - '../avi', - '#/intern/guardedalloc']) - -avi_env.Append (CPPPATH=user_options_dict['JPEG_INCLUDE']) -avi_env.Append (CPPPATH=extra_includes) -avi_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_avi', source=source_files) +env.BlenderLib ('blender_avi', sources, Split(incs), [], libtype='core', priority = 90 ) diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript index ea774092647..df709db5a0b 100644 --- a/source/blender/blenkernel/SConscript +++ b/source/blender/blenkernel/SConscript @@ -1,81 +1,32 @@ #!/usr/bin/python -Import ('user_options_dict') -Import ('library_env') +Import ('env') -blenkernel_env = library_env.Copy () +sources = env.Glob('intern/*.c') -source_files = ['intern/constraint.c', - 'intern/depsgraph.c', - 'intern/DerivedMesh.c', - 'intern/group.c', - 'intern/icons.c', - 'intern/material.c', - 'intern/sca.c', - 'intern/world.c', - 'intern/curve.c', - 'intern/mball.c', - 'intern/scene.c', - 'intern/writeavi.c', - 'intern/action.c', - 'intern/deform.c', - 'intern/image.c', - 'intern/mesh.c', - 'intern/modifier.c', - 'intern/screen.c', - 'intern/anim.c', - 'intern/displist.c', - 'intern/ipo.c', - 'intern/nla.c', - 'intern/sound.c', - 'intern/armature.c', - 'intern/effect.c', - 'intern/key.c', - 'intern/object.c', - 'intern/CCGSubSurf.c', - 'intern/subsurf_ccg.c', - 'intern/blender.c', - 'intern/exotic.c', - 'intern/lattice.c', - 'intern/packedFile.c', - 'intern/text.c', - 'intern/script.c', - 'intern/bmfont.c', - 'intern/font.c', - 'intern/library.c', - 'intern/property.c', - 'intern/softbody.c', - 'intern/node.c', - 'intern/node_shaders.c', - 'intern/node_composite.c', - 'intern/colortools.c', - 'intern/texture.c'] +incs = '. #/intern/guardedalloc ../include ../blenlib ../makesdna' +incs += ' ../python ../render/extern/include #/intern/decimation/extern' +incs += ' ../imbuf ../avi #/intern/elbeem/extern' +incs += ' #/intern/iksolver/extern ../blenloader ../quicktime' -blenkernel_env.Append (CPPPATH = ['.', - '../blenkernel', - '#/intern/guardedalloc', - '../include', - '../blenlib', - '../makesdna', - '../python', - '../render/extern/include', - '../../../intern/decimation/extern', - '../imbuf', - '../avi', - '../quicktime', - '#/intern/elbeem/extern', - '#/intern/iksolver/extern', - '../blenloader']) +incs += ' ' + env['BF_OPENGL_INC'] +incs += ' ' + env['BF_ZLIB_INC'] +incs += ' ' + env['BF_SDL_INC'] -if user_options_dict['USE_INTERNATIONAL'] == 1: - blenkernel_env.Append (CPPDEFINES = 'WITH_FREETYPE2') +defs = '' -#fixme: if user_options_dict['USE_CCGSUBSURFLIB'] == 1: -# blenkernel_env.Append (CPPDEFINES = 'WITH_CCGSUBSURF') +if env['WITH_BF_FREETYPE'] == 1: + defs += 'WITH_FREETYPE2' -blenkernel_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_blenkernel', source=source_files) +if env['WITH_BF_OPENEXR'] == 1: + defs += ' WITH_OPENEXR' -SConscript(['bad_level_call_stubs/SConscript']) +if env['WITH_BF_QUICKTIME'] == 1: + defs += ' WITH_QUICKTIME' + incs += ' ' + env['BF_QUICKTIME_INC'] -blenkernel_env.Append (CPPPATH = user_options_dict['OPENGL_INCLUDE']) -blenkernel_env.Append (CPPPATH = user_options_dict['Z_INCLUDE']) -blenkernel_env.Append (CPPPATH = user_options_dict['SDL_INCLUDE']) +defs += ' WITH_CCGSUBSURF' + +if env['WITH_BF_PLAYER']: + SConscript(['bad_level_call_stubs/SConscript']) + +env.BlenderLib ( libname = 'blenkernel', sources = sources, includes = Split(incs), defines = Split(defs), libtype='core', priority = 65 ) diff --git a/source/blender/blenkernel/bad_level_call_stubs/SConscript b/source/blender/blenkernel/bad_level_call_stubs/SConscript index 1cb06ecc43d..278c74a38f6 100644 --- a/source/blender/blenkernel/bad_level_call_stubs/SConscript +++ b/source/blender/blenkernel/bad_level_call_stubs/SConscript @@ -1,27 +1,14 @@ #!/usr/bin/python -Import ('user_options_dict') -Import ('library_env') +Import ('env') -blenkernel_blc_env = library_env.Copy () +sources = 'stubs.c' -source_files = ['stubs.c' - ] -blenkernel_blc_env.Append (CPPPATH = ['.', - '..', - '../../render/extern/include', - '#/intern/iksolver/extern', - '../../blenlib', - '../../include', - '../../makesdna']) -""" -, - '#/intern/guardedalloc', - '../python', - '../imbuf', - '../avi', - '../blenloader'] -""" -if user_options_dict['USE_INTERNATIONAL'] == 1: - blenkernel_blc_env.Append (CPPDEFINES = 'WITH_FREETYPE2') +incs = '. .. ../../render/extern/include' +incs += ' #/intern/iksolver/extern ../../blenlib' +incs += ' ../../include ../../makesdna' -blenkernel_blc_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_blenkernel_blc', source=source_files) +defs = '' +if env['WITH_BF_FREETYPE'] == 1: + defs += 'WITH_FREETYPE2' + +env.BlenderLib ('blenkernel_blc', sources = Split(sources), includes=Split(incs), defines=Split(defs), libtype='player2',priority=0 ) diff --git a/source/blender/blenlib/SConscript b/source/blender/blenlib/SConscript index e6b50a4e2ff..99c48c74fb2 100644 --- a/source/blender/blenlib/SConscript +++ b/source/blender/blenlib/SConscript @@ -1,47 +1,15 @@ #!/usr/bin/python -Import ('extra_includes') -Import ('user_options_dict') -Import ('library_env') +Import ('env') -blenlib_env = library_env.Copy () +sources = env.Glob('intern/*.c') -source_files = ['intern/BLI_dynstr.c', - 'intern/BLI_ghash.c', - 'intern/edgehash.c', - 'intern/BLI_linklist.c', - 'intern/BLI_memarena.c', - 'intern/arithb.c', - 'intern/dynlib.c', - 'intern/fileops.c', - 'intern/gsqueue.c', - 'intern/matrixops.c', - 'intern/noise.c', - 'intern/psfont.c', - 'intern/rand.c', - 'intern/rct.c', - 'intern/scanfill.c', - 'intern/storage.c', - 'intern/time.c', - 'intern/util.c', - 'intern/vectorops.c', - 'intern/freetypefont.c', - 'intern/jitter.c', - 'intern/threads.c', - 'intern/winstuff.c'] +incs = '. ../makesdna ../blenkernel #/intern/guardedalloc ../include' +incs += ' ' + env['BF_FREETYPE_INC'] +incs += ' ' + env['BF_ZLIB_INC'] +incs += ' ' + env['BF_SDL_INC'] +defs = '' +if env['WITH_BF_FREETYPE'] == 1: + defs = 'WITH_FREETYPE2' -blenlib_env.Append (CPPPATH = ['.', - '../blenlib', - '../makesdna', - '../blenkernel', - '#/intern/guardedalloc', - '../include']) - -if user_options_dict['USE_INTERNATIONAL'] == 1: - blenlib_env.Append (CPPDEFINES = 'WITH_FREETYPE2') - -blenlib_env.Append (CPPPATH = extra_includes) -blenlib_env.Prepend (CPPPATH = user_options_dict['FREETYPE_INCLUDE']) -blenlib_env.Append (CPPPATH = user_options_dict['Z_INCLUDE']) -blenlib_env.Append (CPPPATH = user_options_dict['SDL_INCLUDE']) -blenlib_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_blenlib', source=source_files) +env.BlenderLib ( 'blender_blenlib', sources, Split(incs), Split(defs), libtype='core', priority = 85 ) diff --git a/source/blender/blenloader/SConscript b/source/blender/blenloader/SConscript index 62a652e4174..33e30e56793 100644 --- a/source/blender/blenloader/SConscript +++ b/source/blender/blenloader/SConscript @@ -1,28 +1,13 @@ #!/usr/bin/python -Import ('user_options_dict') -Import ('library_env') +Import ('env') -blenloader_env = library_env.Copy () +sources = env.Glob('intern/*.c') -source_files = ['intern/genfile.c', - 'intern/readblenentry.c', - 'intern/undofile.c', - 'intern/readfile.c', - 'intern/writefile.c'] +incs = '. #/intern/guardedalloc ../blenlib ../blenkernel' +incs += ' ../makesdna ../readblenfile ../include' +incs += ' ../python ../../kernel/gen_messaging' +incs += ' ../render/extern/include' -blenloader_env.Append (CPPPATH = ['.', - '../blenloader', - '#/intern/guardedalloc', - '../blenlib', - '../blenkernel', - '../makesdna', - '../readblenfile', - '../include', - '../python', - '../../kernel/gen_messaging', - '../render/extern/include', - '../writestreamglue', - '../readstreamglue']) +incs += ' ' + env['BF_ZLIB_INC'] -blenloader_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_blenloader', source=source_files) -blenloader_env.Append (CPPPATH = user_options_dict['Z_INCLUDE']) +env.BlenderLib ( 'blender_blenloader', sources, Split(incs), [], libtype='core', priority = 70 ) diff --git a/source/blender/blenpluginapi/SConscript b/source/blender/blenpluginapi/SConscript index 21b89b74d24..f1ba8b3af74 100644 --- a/source/blender/blenpluginapi/SConscript +++ b/source/blender/blenpluginapi/SConscript @@ -1,17 +1,14 @@ #!/usr/bin/python -Import ('user_options_dict') -Import ('library_env') +Import ('env') -blenplugin_env = library_env.Copy () +sources = env.Glob('intern/*.c') -source_files = ['intern/pluginapi.c'] +incs = '. .. #/intern/guardedalloc ../blenlib ../imbuf ../makesdna' -blenplugin_env.Append (CPPPATH = ['.', - '..', - '../blenpluginapi', - '#/intern/guardedalloc', - '../blenlib', - '../imbuf', - '../makesdna']) +defs = [] -blenplugin_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_blenpluginapi', source=source_files) +if env['WITH_BF_QUICKTIME'] == 1: + defs.append('WITH_QUICKTIME') + incs += ' ' + env['BF_QUICKTIME_INC'] + +env.BlenderLib ( libname = 'blender_blenpluginapi', sources = sources, includes = Split(incs), defines = defs, libtype='core', priority = 75 ) diff --git a/source/blender/ftfont/SConscript b/source/blender/ftfont/SConscript index 50cd37d6526..9d9da82fac2 100644 --- a/source/blender/ftfont/SConscript +++ b/source/blender/ftfont/SConscript @@ -1,23 +1,15 @@ #!/usr/bin/python -Import ('extra_includes') -Import ('user_options_dict') -Import ('library_env') +import sys +Import ('env') -ftf_env = library_env.Copy () +sources = env.Glob('intern/*.cpp') -source_files = ['intern/FTF_Api.cpp', - 'intern/FTF_TTFont.cpp'] - -include_paths = ['.', - 'intern', - '../blenkernel', - '../blenlib', - '../makesdna'] +incs = '. intern ../blenkernel ../blenlib ../makesdna' +incs += ' ' + env['BF_FTGL_INC'] +incs += ' ' + env['BF_FREETYPE_INC'] +incs += ' ' + env['BF_GETTEXT_INC'] -ftf_env.Append(CPPPATH = extra_includes) -ftf_env.Append(CPPPATH = include_paths) -ftf_env.Prepend (CPPPATH = user_options_dict['FTGL_INCLUDE']) -ftf_env.Prepend (CPPPATH = user_options_dict['FREETYPE_INCLUDE']) -ftf_env.Prepend (CPPPATH = user_options_dict['GETTEXT_INCLUDE']) -ftf_env.Append(CPPDEFINES = 'FTGL_STATIC_LIBRARY') -ftf_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_FTF', source=source_files) +defs = 'FTGL_STATIC_LIBRARY' +if sys.platform == 'win32': + defs += ' _WIN32 USE_GETTEXT_DLL' +env.BlenderLib ( 'blender_FTF', sources, Split(incs), Split(defs), libtype='international', priority=0 ) diff --git a/source/blender/imbuf/SConscript b/source/blender/imbuf/SConscript index c73c0593a86..938e306e7f6 100644 --- a/source/blender/imbuf/SConscript +++ b/source/blender/imbuf/SConscript @@ -1,56 +1,23 @@ #!/usr/bin/python -Import ('extra_includes') -Import ('user_options_dict') -Import ('library_env') +Import ('env') -imbuf_env = library_env.Copy () +sources = env.Glob('intern/*.c') -#if user_options_dict['USE_OPENEXR'] == 1: -# SConscript (['intern/openexr/SConscript']) +incs = '. ../makesdna #/intern/guardedalloc ../blenlib' +incs += ' ../avi ../quicktime ../blenkernel' -source_files = ['intern/allocimbuf.c', - 'intern/amiga.c', - 'intern/anim.c', - 'intern/anim5.c', - 'intern/antialias.c', - 'intern/bitplanes.c', - 'intern/bmp.c', - 'intern/cmap.c', - 'intern/cspace.c', - 'intern/data.c', - 'intern/dither.c', - 'intern/divers.c', - 'intern/dynlibtiff.c', - 'intern/filter.c', - 'intern/ham.c', - 'intern/hamx.c', - 'intern/iff.c', - 'intern/imageprocess.c', - 'intern/iris.c', - 'intern/jpeg.c', - 'intern/png.c', - 'intern/radiance_hdr.c', - 'intern/readimage.c', - 'intern/rectop.c', - 'intern/rotate.c', - 'intern/scaling.c', - 'intern/targa.c', - 'intern/tiff.c', - 'intern/util.c', - 'intern/writeimage.c'] +incs += ' ' + env['BF_JPEG_INC'] +incs += ' ' + env['BF_PNG_INC'] +incs += ' ' + env['BF_TIFF_INC'] +incs += ' ' + env['BF_ZLIB_INC'] -imbuf_env.Append (CPPPATH = ['.', - '../imbuf', - '../makesdna', - '#/intern/guardedalloc', - '../blenlib', - '../avi', - '../quicktime', - '../blenkernel']) +defs = [] -imbuf_env.Append (CPPPATH = user_options_dict['JPEG_INCLUDE']) -imbuf_env.Append (CPPPATH = user_options_dict['PNG_INCLUDE']) -imbuf_env.Append (CPPPATH = user_options_dict['TIFF_INCLUDE']) -imbuf_env.Append (CPPPATH = user_options_dict['Z_INCLUDE']) -imbuf_env.Append (CPPPATH = extra_includes) -imbuf_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_imbuf', source=source_files) +if env['WITH_BF_OPENEXR'] == 1: + defs.append('WITH_OPENEXR') + +if env['WITH_BF_QUICKTIME']==1: + incs += ' ' + env['BF_QUICKTIME_INC'] + defs.append('WITH_QUICKTIME') + +env.BlenderLib ( libname = 'blender_imbuf', sources = sources, includes = Split(incs), defines = defs, libtype='core', priority = 80 ) diff --git a/source/blender/imbuf/intern/openexr/SConscript b/source/blender/imbuf/intern/openexr/SConscript index 22b61500cc2..ec7b9b3518d 100644 --- a/source/blender/imbuf/intern/openexr/SConscript +++ b/source/blender/imbuf/intern/openexr/SConscript @@ -1,22 +1,17 @@ #!/usr/bin/python -Import ('extra_includes') -Import ('user_options_dict') -Import ('library_env') +Import ('env') -openexr_env = library_env.Copy () +source_files = ['openexr_api.cpp'] -source_files = ['openexr_api.cpp' - ] +incs = ['.', + '../../../blenkernel', + '../../', + '..', + '../../../blenlib', + '../../../makesdna'] +incs += Split(env['BF_OPENEXR_INC']) -include_paths = ['.', - '../../../blenkernel', - '../../', - '..', - '../../../blenlib', - '../../../makesdna'] +defs = [] -openexr_env.Append(CPPPATH = extra_includes) -openexr_env.Append(CPPPATH = include_paths) -openexr_env.Prepend (CPPPATH = user_options_dict['OPENEXR_INCLUDE']) -#ftf_env.Append(CPPDEFINES = 'FTGL_STATIC_LIBRARY') -openexr_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_openexr', source=source_files) +#openexr_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_openexr', source=source_files) +env.BlenderLib ('blender_openexr', source_files, incs, defs, libtype='core', priority = 90) diff --git a/source/blender/img/SConscript b/source/blender/img/SConscript index ed4564a3348..a2a60c3428b 100644 --- a/source/blender/img/SConscript +++ b/source/blender/img/SConscript @@ -1,15 +1,6 @@ -#!/usr/bin/python -Import ('user_options_dict') -Import ('library_env') +#!/usr/bin/env python +Import ('env') -img_env = library_env.Copy () +sources = env.Glob('intern/*.cpp') -source_files = ['intern/IMG_Api.cpp', - 'intern/IMG_BrushRGBA32.cpp', - 'intern/IMG_CanvasRGBA32.cpp', - 'intern/IMG_Line.cpp', - 'intern/IMG_Pixmap.cpp', - 'intern/IMG_PixmapRGBA32.cpp', - 'intern/IMG_Rect.cpp'] - -img_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_img', source=source_files) +env.BlenderLib ( 'blender_img', sources, [], [], libtype='core', priority = 35 ) diff --git a/source/blender/makesdna/SConscript b/source/blender/makesdna/SConscript index c9b352365ff..3978f8bbf48 100644 --- a/source/blender/makesdna/SConscript +++ b/source/blender/makesdna/SConscript @@ -1,14 +1,11 @@ #!/usr/bin/python -Import ('user_options_dict') -Import ('library_env') - -makesdna_env = library_env.Copy () +Import ('env') objs = [] o = SConscript('intern/SConscript') objs.append (o) -makesdna_env.Append (CPPPATH = ['#/intern/guardedalloc']) +incs = '#/intern/guardedalloc' -makesdna_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_makesdna', source=objs) +env.BlenderLib ( 'blender_makesdna', objs, Split(incs), [], libtype='common', priority = 10 ) diff --git a/source/blender/makesdna/intern/SConscript b/source/blender/makesdna/intern/SConscript index e30f14f69ce..2e18528aaa4 100644 --- a/source/blender/makesdna/intern/SConscript +++ b/source/blender/makesdna/intern/SConscript @@ -2,33 +2,39 @@ import sys import os -Import ('cflags') -Import ('defines') -Import ('user_options_dict') +#Import ('cflags') +#Import ('defines') +Import ('env') +cflags = '' +defines = [] +root_build_dir=env['BF_BUILDDIR'] # TODO: make sure the makesdna program does not get installed on the system. source_files = ['makesdna.c'] -makesdna_tool = Environment (ENV = os.environ, CCFLAGS='-DBASE_HEADER="\\"source/blender/makesdna/\\"" ') +makesdna_tool = env.Copy() +dna = env.Copy() +makesdna_tool.Append(CCFLAGS = '-DBASE_HEADER="\\"source/blender/makesdna/\\"" ') +#makesdna_tool = Environment (ENV = os.environ, CCFLAGS='-DBASE_HEADER="\\"source/blender/makesdna/\\"" ') makesdna_tool.Append (CPPPATH = ['#/intern/guardedalloc', '../../makesdna']) -makesdna_tool.Replace (CC = user_options_dict['HOST_CC']) -makesdna_tool.Replace (PATH = user_options_dict['PATH']) +#makesdna_tool.Replace (CC = user_options_dict['HOST_CC']) +#makesdna_tool.Replace (PATH = user_options_dict['PATH']) if sys.platform != 'cygwin': - makesdna_tool.Append (CCFLAGS = cflags) - makesdna_tool.Append (LINKFLAGS = user_options_dict['PLATFORM_LINKFLAGS']) + makesdna_tool.Append (CCFLAGS = cflags) + #makesdna_tool.Append (LINKFLAGS = user_options_dict['PLATFORM_LINKFLAGS']) makesdna_tool.Append (CPPDEFINES = defines) -makesdna_tool.Append (LIBPATH = '#'+user_options_dict['BUILD_DIR']+'/lib') +makesdna_tool.Append (LIBPATH = '#'+root_build_dir+'/lib') makesdna_tool.Append (LIBS = 'blender_guardedalloc') -makesdna_tool.Program (target = '#'+user_options_dict['BUILD_DIR']+'makesdna', source = source_files) +makesdna_tool.Program (target = '#'+root_build_dir+'makesdna', source = source_files) -dna = Environment (ENV = os.environ) +#dna = Environment (ENV = os.environ) dna_dict = dna.Dictionary() -makesdna_name = user_options_dict['BUILD_DIR']+'makesdna' + dna_dict['PROGSUFFIX'] +makesdna_name = root_build_dir+'makesdna' + dna_dict['PROGSUFFIX'] dna.Depends ('dna.c', '#'+makesdna_name) -dna.Command ('dna.c', '', user_options_dict['BUILD_DIR']+"makesdna $TARGET") +dna.Command ('dna.c', '', root_build_dir+"makesdna $TARGET") obj = 'intern/dna.c' Return ('obj') diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript index aedafd84e96..a0622849465 100644 --- a/source/blender/python/SConscript +++ b/source/blender/python/SConscript @@ -1,81 +1,18 @@ #!/usr/bin/python -Import ('extra_includes') -Import ('user_options_dict') -Import ('library_env') +Import ('env') -python_env = library_env.Copy () +sources = Split('BPY_interface.c BPY_menus.c') + env.Glob('api2_2x/*.c') -source_files = ['BPY_interface.c', - 'BPY_menus.c', - 'api2_2x/Armature.c', - 'api2_2x/BezTriple.c', - 'api2_2x/BGL.c', - 'api2_2x/Blender.c', - 'api2_2x/Bone.c', - 'api2_2x/Camera.c', - 'api2_2x/CurNurb.c', - 'api2_2x/Curve.c', - 'api2_2x/Draw.c', - 'api2_2x/Effect.c', - 'api2_2x/Font.c', - 'api2_2x/EXPP_interface.c', - 'api2_2x/Ipocurve.c', - 'api2_2x/Ipo.c', - 'api2_2x/Key.c', - 'api2_2x/Lamp.c', - 'api2_2x/Lattice.c', - 'api2_2x/Library.c', - 'api2_2x/MTex.c', - 'api2_2x/Material.c', - 'api2_2x/Mathutils.c', - 'api2_2x/Mesh.c', - 'api2_2x/Metaball.c', - 'api2_2x/NLA.c', - 'api2_2x/Noise.c', - 'api2_2x/NMesh.c', - 'api2_2x/Object.c', - 'api2_2x/Pose.c', - 'api2_2x/point.c', - 'api2_2x/Registry.c', - 'api2_2x/Scene.c', - 'api2_2x/Sound.c', - 'api2_2x/Sys.c', - 'api2_2x/Types.c', - 'api2_2x/Window.c', - 'api2_2x/World.c', - 'api2_2x/Pose.c', - 'api2_2x/Image.c', - 'api2_2x/Text.c', - 'api2_2x/Text3d.c', - 'api2_2x/Texture.c', - 'api2_2x/Noise.c', - 'api2_2x/charRGBA.c', - 'api2_2x/constant.c', - 'api2_2x/euler.c', - 'api2_2x/gen_utils.c', - 'api2_2x/logic.c', - 'api2_2x/matrix.c', - 'api2_2x/quat.c', - 'api2_2x/rgbTuple.c', - 'api2_2x/sceneRender.c', - 'api2_2x/sceneRadio.c', - 'api2_2x/sceneTimeLine.c', - 'api2_2x/vector.c', - 'api2_2x/windowTheme.c'] +incs = 'api2_2x ../blenkernel ../blenlib ../blenloader' +incs += ' ../render/extern/include ../radiosity/extern/include' +incs += ' ../makesdna #intern/guardedalloc #intern/bmfont ../imbuf ../include' +incs += ' ' + env['BF_PYTHON_INC'] +incs += ' ' + env['BF_OPENGL_INC'] -python_env.Append (CPPPATH = ['api2_2x', - '../blenkernel', - '../blenlib', - '../blenloader', - '../render/extern/include', - '../radiosity/extern/include', - '../makesdna', - '#/intern/guardedalloc', - '#/intern/bmfont', - '../imbuf', - '../include']) +defs = [] -python_env.Append (CPPPATH = user_options_dict['PYTHON_INCLUDE']) -python_env.Append (CPPPATH = user_options_dict['OPENGL_INCLUDE']) -python_env.Append (CPPPATH = extra_includes) -python_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_python', source=source_files) +if env['WITH_BF_QUICKTIME']==1: + incs += ' ' + env['BF_QUICKTIME_INC'] + defs.append('WITH_QUICKTIME') + +env.BlenderLib ( libname='blender_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype=['core','game2'], priority = [60,115] ) diff --git a/source/blender/quicktime/SConscript b/source/blender/quicktime/SConscript index f47611bbb13..dafbb865bf6 100644 --- a/source/blender/quicktime/SConscript +++ b/source/blender/quicktime/SConscript @@ -1,26 +1,22 @@ #!/usr/bin/python -Import ('extra_includes') -Import ('user_options_dict') -Import ('library_env') - -quicktime_env = library_env.Copy () - -quicktime_env.Append (CPPPATH = extra_includes) +Import ('env') source_files = ['apple/quicktime_import.c', 'apple/quicktime_export.c'] -quicktime_env.Append (CPPPATH = ['.', - '../quicktime', - '../makesdna', - '#/intern/guardedalloc', - '../blenlib', - '../blenkernel', - '../avi', - '../imbuf', - '../imbuf/intern', - '../blenloader', - '../render/extern/include', - '../include']) +incs = ['.', + '../quicktime', + '../makesdna', + '#/intern/guardedalloc', + '../blenlib', + '../blenkernel', + '../avi', + '../imbuf', + '../imbuf/intern', + '../blenloader', + '../render/extern/include', + '../include'] + +incs.append(env['BF_QUICKTIME_INC']) -quicktime_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_quicktime', source=source_files) +env.BlenderLib ('blender_quicktime', sources=source_files, includes=incs, defines=['WITH_QUICKTIME'], libtype='core', priority=95) diff --git a/source/blender/radiosity/SConscript b/source/blender/radiosity/SConscript index 0c7205e6a83..102f79683f9 100644 --- a/source/blender/radiosity/SConscript +++ b/source/blender/radiosity/SConscript @@ -1,26 +1,12 @@ #!/usr/bin/python -Import ('user_options_dict') -Import ('library_env') +Import ('env') -rad_env = library_env.Copy () +sources = env.Glob('intern/source/*.c') -source_files = ['intern/source/raddisplay.c', - 'intern/source/radfactors.c', - 'intern/source/radrender.c', - 'intern/source/radio.c', - 'intern/source/radnode.c', - 'intern/source/radpostprocess.c', - 'intern/source/radpreprocess.c'] +incs = 'extern/include ../blenlib ../blenkernel ../makesdna ../include' +incs += ' #/intern/guardedalloc ../render/extern/include' +incs += ' ../render/intern/include' -rad_env.Append (CPPPATH = ['extern/include', - '../blenlib', - '../blenkernel', - '../makesdna', - '../include', - '#/intern/guardedalloc', - '../render/extern/include', - '../render/intern/include']) +incs += ' ' + env['BF_OPENGL_INC'] -rad_env.Append (CPPPATH = user_options_dict['OPENGL_INCLUDE']) - -rad_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_radiosity', source=source_files) +env.BlenderLib ( 'blender_radiosity', sources, Split(incs), [], libtype='core', priority=50 ) diff --git a/source/blender/readblenfile/SConscript b/source/blender/readblenfile/SConscript index 1f0909b1f84..901871ad298 100644 --- a/source/blender/readblenfile/SConscript +++ b/source/blender/readblenfile/SConscript @@ -1,20 +1,8 @@ #!/usr/bin/python -Import ('user_options_dict') -Import ('library_env') +Import ('env') -readblenfile_env = library_env.Copy () +sources = env.Glob('intern/*.c') -source_files = ['intern/BLO_readblenfile.c'] +incs = '. ../blenloader ../blenloader/intern ../blenkernel ../blenlib ../makesdna ../../kernel/gen_messaging' -readblenfile_env.Append (CPPPATH = ['.', - -'../readblenfile', - '../readstreamglue', - '../blenloader', - '../blenloader/intern', - '../blenkernel', - '../blenlib', - '../makesdna', - '../../kernel/gen_messaging']) - -readblenfile_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_readblenfile', source=source_files) +env.BlenderLib ( 'blender_readblenfile', sources, Split(incs), [], libtype='common', priority = 0 ) diff --git a/source/blender/render/SConscript b/source/blender/render/SConscript index 256d4b16d86..b6243ecbcfb 100644 --- a/source/blender/render/SConscript +++ b/source/blender/render/SConscript @@ -1,39 +1,18 @@ #!/usr/bin/python -Import ('user_options_dict') -Import ('library_env') +Import ('env') -render_env = library_env.Copy () +sources = env.Glob('intern/source/*.c') -source_files = ['intern/source/convertblender.c', - 'intern/source/edgeRender.c', - 'intern/source/envmap.c', - 'intern/source/gammaCorrectionTables.c', - 'intern/source/imagetexture.c', - 'intern/source/initrender.c', - 'intern/source/pixelblending.c', - 'intern/source/pixelshading.c', - 'intern/source/pipeline.c', - 'intern/source/ray.c', - 'intern/source/rendercore.c', - 'intern/source/renderdatabase.c', - 'intern/source/shadbuf.c', - 'intern/source/texture.c', - 'intern/source/zbuf.c'] +incs = 'intern/include #/intern/guardedalloc ../blenlib ../makesdna' +incs += ' extern/include ../blenkernel ../radiosity/extern/include ../imbuf' +incs += ' ../quicktime ../include ../../kernel/gen_messaging ../yafray' +incs += ' ' + env['BF_SDL_INC'] -render_env.Append (CPPPATH = ['intern/include', - '#/intern/guardedalloc', - '../blenlib', - '../makesdna', - 'extern/include', - '../blenkernel', - '../radiosity/extern/include', - '../imbuf', - '../quicktime', - '../include', - '../../kernel/gen_messaging', - '../yafray']) +defs = [] -render_env.Append (CPPPATH = user_options_dict['SDL_INCLUDE']) +if env['WITH_BF_QUICKTIME'] == 1: + defs.append('WITH_QUICKTIME') + incs += ' ' + env['BF_QUICKTIME_INC'] -render_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_render', source=source_files) +env.BlenderLib ( libname = 'blender_render', sources = sources, includes = Split(incs), defines=defs, libtype='core', priority=45 ) diff --git a/source/blender/src/SConscript b/source/blender/src/SConscript index bc5d9a3baa4..1243e81609f 100644 --- a/source/blender/src/SConscript +++ b/source/blender/src/SConscript @@ -1,181 +1,38 @@ #!/usr/bin/python -Import ('extra_includes') -Import ('user_options_dict') -Import ('library_env') -Import ('defines') +Import ('env') -src_env = library_env.Copy () -src_env.Append (CCFLAGS = user_options_dict['SDL_CFLAGS']) -src_env.Append(CPPDEFINES = defines) +# TODO: src_env.Append (CCFLAGS = user_options_dict['SDL_CFLAGS']) -source_files = ['B.blend.c', - 'Bfont.c', - 'bfont.ttf.c', - 'blenderbuttons.c', - 'booleanops.c', - 'booleanops_mesh.c', - 'buttons_editing.c', - 'buttons_logic.c', - 'buttons_object.c', - 'buttons_scene.c', - 'buttons_script.c', - 'buttons_shading.c', - 'butspace.c', - 'cmap.tga.c', - 'cmovie.tga.c', - 'cursors.c', - 'drawaction.c', - 'drawarmature.c', - 'drawdeps.c', - 'drawimage.c', - 'drawimasel.c', - 'drawipo.c', - 'drawmesh.c', - 'drawnla.c', - 'drawobject.c', - 'drawoops.c', - 'drawscene.c', - 'drawscript.c', - 'drawseq.c', - 'drawsound.c', - 'drawtext.c', - 'drawtime.c', - 'drawview.c', - 'drawnode.c', - 'edit.c', - 'editaction.c', - 'editarmature.c', - 'editconstraint.c', - 'editcurve.c', - 'editdeform.c', - 'editface.c', - 'editfont.c', - 'editgroup.c', - 'editimasel.c', - 'editipo.c', - 'editipo_lib.c', - 'editipo_mods.c', - 'editkey.c', - 'editlattice.c', - 'editmball.c', - 'editmesh.c', - 'editnode.c', - 'editmesh_add.c', - 'editmesh_lib.c', - 'editmesh_loop.c', - 'editmesh_mods.c', - 'editmesh_tools.c', - 'editmode_undo.c', - 'editnla.c', - 'editobject.c', - 'editoops.c', - 'editscreen.c', - 'editseq.c', - 'editsima.c', - 'editsound.c', - 'edittime.c', - 'editview.c', - 'eventdebug.c', - 'filesel.c', - 'fluidsim.c', - 'ghostwinlay.c', - 'glutil.c', - 'headerbuttons.c', - 'header_action.c', - 'header_buttonswin.c', - 'header_filesel.c', - 'header_image.c', - 'header_imasel.c', - 'header_info.c', - 'header_ipo.c', - 'header_nla.c', - 'header_oops.c', - 'header_script.c', - 'header_seq.c', - 'header_sound.c', - 'header_text.c', - 'header_time.c', - 'header_view3d.c', - 'header_node.c', - 'imagepaint.c', - 'imasel.c', - 'interface.c', - 'interface_panel.c', - 'interface_draw.c', - 'interface_icons.c', - 'keyval.c', - 'lorem.c', - 'mainqueue.c', - 'meshtools.c', - 'mywindow.c', - 'oops.c', - 'outliner.c', - 'splash.jpg.c', - 'parametrizer.c', - 'playanim.c', - 'poseobject.c', - 'previewrender.c', - 'preview.blend.c', - 'renderwin.c', - 'resources.c', - 'scrarea.c', - 'screendump.c', - 'sequence.c', - 'seqaudio.c', - 'space.c', - 'spacetypes.c', - 'swapbuffers.c', - 'toets.c', - 'toolbox.c', - 'transform.c', - 'transform_generics.c', - 'transform_numinput.c', - 'transform_constraints.c', - 'transform_conversions.c', - 'transform_manipulator.c', - 'unwrapper.c', - 'usiblender.c', - 'view.c', - 'vpaint.c', - 'writeavicodec.c', - 'writeimage.c', - 'writemovie.c', - 'language.c'] +sources = env.Glob('*.c') -src_env.Append (CPPPATH = ['#/intern/guardedalloc', - '../blenlib', - '../makesdna', - '../blenkernel', - '../include', - '#/intern/bmfont', - '../imbuf', - '../render/extern/include', - '#/intern/bsp/extern', - '../radiosity/extern/include', - '#/intern/decimation/extern', - '../blenloader', - '../python', - '../../kernel/gen_system', - '#/intern/SoundSystem', - '../readstreamglue', - '../img', - '../quicktime', - '#/intern/elbeem/extern', - '#/intern/ghost', - '#/intern/opennl/extern']) +incs = ' #/intern/guardedalloc ../blenlib ../makesdna ../blenkernel' +incs += ' ../include #/intern/bmfont ../imbuf ../render/extern/include' +incs += ' #/intern/bsp/extern ../renderconverter ../radiosity/extern/include' +incs += ' #/intern/decimation/extern ../blenloader ../python' +incs += ' ../../kernel/gen_system #/intern/SoundSystem ../readstreamglue' +incs += ' ../img ../quicktime #/intern/elbeem/extern' +incs += ' #/intern/ghost #/intern/opennl/extern' -src_env.Append (CPPPATH = user_options_dict['PYTHON_INCLUDE']) -src_env.Append (CPPPATH = user_options_dict['SDL_INCLUDE']) -src_env.Append (CPPPATH = user_options_dict['OPENGL_INCLUDE']) +incs += ' ' + env['BF_PYTHON_INC'] +incs += ' ' + env['BF_SDL_INC'] +incs += ' ' + env['BF_OPENGL_INC'] -if user_options_dict['USE_INTERNATIONAL'] == 1: - src_env.Append (CPPPATH=['../ftfont']) - src_env.Append (CPPDEFINES = 'INTERNATIONAL') - src_env.Append (CPPDEFINES = 'FTGL_STATIC_LIBRARY') +defs = [] -if user_options_dict['USE_BUILDINFO'] == 1: - src_env.Append (CPPDEFINES = 'NAN_BUILDINFO') +if env['WITH_BF_FREETYPE'] == 1: + incs += ' ../ftfont' + defs.append('INTERNATIONAL') + defs.append('FTGL_STATIC_LIBRARY') -src_env.Append (CPPPATH=extra_includes) +if env['WITH_BF_OPENEXR'] == 1: + defs.append('WITH_OPENEXR') -src_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_blendersrc', source=source_files) +if env['WITH_BF_QUICKTIME']==1: + incs += ' ' + env['BF_QUICKTIME_INC'] + defs.append('WITH_QUICKTIME') + +# TODO buildinfo +#if env['USE_BUILDINFO'] == 1: +# defs += ' NAN_BUILDINFO' + +env.BlenderLib ( libname = 'src', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] ) diff --git a/source/blender/yafray/SConscript b/source/blender/yafray/SConscript index a50ed2243fe..8da3b16fbfe 100644 --- a/source/blender/yafray/SConscript +++ b/source/blender/yafray/SConscript @@ -1,22 +1,9 @@ #!/usr/bin/python -Import ('user_options_dict') -Import ('library_env') +Import ('env') -yafray_env = library_env.Copy () +sources = env.Glob('intern/*.cpp') -source_files = ['intern/yafray_Render.cpp', - 'intern/export_File.cpp', - 'intern/export_Plugin.cpp', - 'intern/yafexternal.cpp', - 'intern/api.cpp'] +incs = '#/intern/guardedalloc ../blenlib ../makesdna ../blenkernel' +incs += ' ../imbuf ../include ../render/extern/include ../render/intern/include' -yafray_env.Append (CPPPATH = ['#/intern/guardedalloc', - '../blenlib', - '../makesdna', - '../blenkernel', - '../imbuf', - '../include', - '../render/extern/include', - '../render/intern/include']) - -yafray_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_yafray', source=source_files) +env.BlenderLib ( 'blender_yafray', sources, Split(incs), [], libtype='blender', priority=5 ) -- cgit v1.2.3