=Scons=
[blender.git] / source / blender / src / SConscript
index 91c75559f2c165fed20daf08722e884a8fbc934a..58aa3ddad88171619786bd198667186eeaa2cf5e 100644 (file)
-src_env = Environment()
-
-# Import the C flags set in the SConstruct file
-Import ('cflags')
-Import ('cxxflags')
-Import ('defines')
-Import ('extra_includes')
-Import ('user_options_dict')
-src_env.Append (CCFLAGS = cflags)
-src_env.Append (CCFLAGS = user_options_dict['SDL_CFLAGS'])
-src_env.Append (CXXFLAGS = cxxflags)
-src_env.Append (CPPDEFINES = defines)
-
-source_files = ['B.blend.c',
-                'Bfont.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',
-                'drawimage.c',
-                'drawimasel.c',
-                'drawipo.c',
-                'drawmesh.c',
-                'drawnla.c',
-                'drawobject.c',
-                'drawoops.c',
-                'drawscene.c',
-                'drawscript.c',
-                'drawseq.c',
-                'drawsound.c',
-                'drawtext.c',
-                'drawview.c',
-                'edit.c',
-                'editaction.c',
-                'editarmature.c',
-                'editconstraint.c',
-                'editcurve.c',
-                'editdeform.c',
-                'editface.c',
-                'editfont.c',
-                'editgroup.c',
-                'editika.c',
-                'editimasel.c',
-                'editipo.c',
-                'editkey.c',
-                'editlattice.c',
-                'editmball.c',
-                'editmesh.c',
-                'editnla.c',
-                'editobject.c',
-                'editoops.c',
-                'editscreen.c',
-                'editseq.c',
-                'editsima.c',
-                'editsound.c',
-                'editview.c',
-                'eventdebug.c',
-                'filesel.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_view3d.c',
-                'imasel.c',
-                'interface.c',
-                'interface_panel.c',
-                'interface_draw.c',
-                'keyval.c',
-                'mainqueue.c',
-                'mywindow.c',
-                'oops.c',
-                'splash.jpg.c',
-                'playanim.c',
-                'poseobject.c',
-                'previewrender.c',
-                'renderwin.c',
-                'resources.c',
-                'scrarea.c',
-                'screendump.c',
-                'sequence.c',
-                'seqaudio.c',
-                'space.c',
-                'spacetypes.c',
-                'swapbuffers.c',
-                'toets.c',
-                'toolbox.c',
-                'usiblender.c',
-                'view.c',
-                'vpaint.c',
-                'writeavicodec.c',
-                'writeimage.c',
-                'writemovie.c',
-                'language.c']
-
-src_env.Append (CPPPATH = ['#/intern/guardedalloc',
-                           '../blenlib',
-                           '../makesdna',
-                           '../blenkernel',
-                           '../include',
-                           '#/intern/bmfont',
-                           '../imbuf',
-                           '../render/extern/include',
-                           '#/intern/bsp/extern',
-                           '../renderconverter',
-                           '../radiosity/extern/include',
-                           '#/intern/decimation/extern',
-                           '../blenloader',
-                           '../python',
-                           '../../kernel/gen_system',
-                           '#/intern/SoundSystem',
-                           '../readstreamglue',
-                           '../img',
-                           '../quicktime',
-                           '#/intern/ghost'])
-
-src_env.Append (CPPPATH = user_options_dict['PYTHON_INCLUDE'])
-src_env.Append (CPPPATH = user_options_dict['SDL_INCLUDE'])
-
-if user_options_dict['USE_INTERNATIONAL'] == 1:
-    src_env.Append (CPPPATH=['../ftfont'])
-    src_env.Append (CPPDEFINES = 'INTERNATIONAL')
-    src_env.Append (CPPDEFINES = 'FTGL_STATIC_LIBRARY')
-
-src_env.Append (CPPPATH=extra_includes)
-
-src_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_blendersrc', source=source_files)
+#!/usr/bin/python
+Import ('env')
+
+# TODO: src_env.Append (CCFLAGS = user_options_dict['SDL_CFLAGS'])
+
+sources = env.Glob('*.c')
+numobj = len(sources)
+maxobj = 30
+
+numlibs = numobj / maxobj
+if (numobj % maxobj):
+       numlibs = numlibs + 1
+subsources = []
+
+if (env['OURPLATFORM'] == 'win32-mingw'):
+    for i in range(numlibs - 1):
+        subsources.append(sources[i*maxobj:(i+1)*maxobj])
+    subsources.append(sources[(numlibs-1)*maxobj:])
+
+incs = ' #/intern/guardedalloc #/intern/memutil'
+incs += ' ../blenlib ../makesdna ../blenkernel'
+incs += ' ../include #/intern/bmfont ../imbuf ../render/extern/include'
+incs += ' #/intern/bsp/extern ../radiosity/extern/include'
+incs += ' #/intern/decimation/extern ../blenloader ../python'
+incs += ' ../../kernel/gen_system #/intern/SoundSystem ../readstreamglue'
+incs += ' ../quicktime #/intern/elbeem/extern'
+incs += ' #/intern/ghost #/intern/opennl/extern'
+
+incs += ' ' + env['BF_PYTHON_INC']
+incs += ' ' + env['BF_SDL_INC']
+incs += ' ' + env['BF_OPENGL_INC']
+
+defs = []
+
+if env['WITH_BF_YAFRAY'] == 0:
+    defs.append('DISABLE_YAFRAY')
+
+if env['WITH_BF_INTERNATIONAL'] == 1:
+    incs += ' ../ftfont'
+    defs.append('INTERNATIONAL')
+    defs.append('FTGL_STATIC_LIBRARY')
+
+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')
+
+if env['WITH_BF_ICONV'] == 1:
+    incs += ' ' + env['BF_ICONV_INC']
+    defs.append('WITH_ICONV')
+
+if env['WITH_BF_FFMPEG'] == 1:
+    defs.append('WITH_FFMPEG')
+    incs += ' ' + env['BF_FFMPEG_INC']
+
+if env['WITH_BF_VERSE']:
+    defs.append('WITH_VERSE')
+    incs += ' ' + env['BF_VERSE_INCLUDE']
+
+# TODO buildinfo
+if env['BF_BUILDINFO'] == 1:
+    defs.append('NAN_BUILDINFO')
+
+if (env['OURPLATFORM'] == 'win32-mingw'):
+    for i in range(numlibs):
+        env.BlenderLib ( libname = 'src%d' % (i), sources = subsources[i], includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )
+else:
+    env.BlenderLib ( libname = 'src', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )