buildsystem cleanup: remove duplicate source & includes for scons,

add a check for duplicates in BlenderLib()m, if 0'd now.
This commit is contained in:
Campbell Barton
2012-11-14 01:41:24 +00:00
parent de5d0d649d
commit 050f09aa6c
8 changed files with 22 additions and 10 deletions

View File

@@ -790,6 +790,20 @@ class BlenderEnvironment(SConsEnvironment):
def BlenderLib(self=None, libname=None, sources=None, includes=[], defines=[], libtype='common', priority = 100, compileflags=None, cc_compileflags=None, cxx_compileflags=None, cc_compilerchange=None, cxx_compilerchange=None): def BlenderLib(self=None, libname=None, sources=None, includes=[], defines=[], libtype='common', priority = 100, compileflags=None, cc_compileflags=None, cxx_compileflags=None, cc_compilerchange=None, cxx_compilerchange=None):
global vcp global vcp
# sanity check
# run once in a while to check we dont have duplicates
if 0:
for name, dirs in (("source", sources), ("include", includes)):
files_clean = [os.path.normpath(f) for f in dirs]
files_clean_set = set(files_clean)
if len(files_clean) != len(files_clean_set):
for f in sorted(files_clean_set):
if f != '.' and files_clean.count(f) > 1:
raise Exception("Found duplicate %s %r" % (name, f))
del name, dirs, files_clean, files_clean_set, f
# end sanity check
if not self or not libname or not sources: if not self or not libname or not sources:
print bc.FAIL+'Cannot continue. Missing argument for BuildBlenderLib '+libname+bc.ENDC print bc.FAIL+'Cannot continue. Missing argument for BuildBlenderLib '+libname+bc.ENDC
self.Exit() self.Exit()

View File

@@ -3,7 +3,7 @@ Import ('env')
sources = env.Glob('*.c') sources = env.Glob('*.c')
incs = '../include ../../blenlib ../../blenkernel ../../blenfont ../../makesdna ../../imbuf' incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
incs += ' ../../makesrna ../../blenloader ../../blenfont' incs += ' ../../makesrna ../../blenloader ../../blenfont'
incs += ' #/intern/audaspace/intern' incs += ' #/intern/audaspace/intern'

View File

@@ -27,7 +27,6 @@ sources.extend((
os.path.join(env['DATA_SOURCES'], "gpu_shader_vertex.glsl.c"), os.path.join(env['DATA_SOURCES'], "gpu_shader_vertex.glsl.c"),
os.path.join(env['DATA_SOURCES'], "gpu_shader_sep_gaussian_blur_frag.glsl.c"), os.path.join(env['DATA_SOURCES'], "gpu_shader_sep_gaussian_blur_frag.glsl.c"),
os.path.join(env['DATA_SOURCES'], "gpu_shader_sep_gaussian_blur_vert.glsl.c"), os.path.join(env['DATA_SOURCES'], "gpu_shader_sep_gaussian_blur_vert.glsl.c"),
os.path.join(env['DATA_SOURCES'], "gpu_shader_material.glsl.c"),
os.path.join(env['DATA_SOURCES'], "gpu_shader_vsm_store_frag.glsl.c"), os.path.join(env['DATA_SOURCES'], "gpu_shader_vsm_store_frag.glsl.c"),
os.path.join(env['DATA_SOURCES'], "gpu_shader_vsm_store_vert.glsl.c"), os.path.join(env['DATA_SOURCES'], "gpu_shader_vsm_store_vert.glsl.c"),
)) ))

View File

@@ -3,16 +3,17 @@ Import ('env')
source_files = ['dds_api.cpp', 'DirectDrawSurface.cpp', 'Stream.cpp', 'BlockDXT.cpp', 'ColorBlock.cpp', 'Image.cpp', 'FlipDXT.cpp'] source_files = ['dds_api.cpp', 'DirectDrawSurface.cpp', 'Stream.cpp', 'BlockDXT.cpp', 'ColorBlock.cpp', 'Image.cpp', 'FlipDXT.cpp']
incs = ['.', incs = [
'../../', '.',
'../..',
'..', '..',
'../..',
'../../../makesdna', '../../../makesdna',
'../../../blenkernel', '../../../blenkernel',
'../../../blenlib', '../../../blenlib',
'intern/include', 'intern/include',
'#/intern/guardedalloc', '#/intern/guardedalloc',
'#/intern/utfconv'] '#/intern/utfconv'
]
defs = ['WITH_DDS'] defs = ['WITH_DDS']

View File

@@ -11,7 +11,7 @@ incs += ' #source/gameengine/BlenderRoutines #source/blender/imbuf'
incs += ' #intern/moto/include #source/gameengine/Ketsji #source/gameengine/Ketsji/KXNetwork' incs += ' #intern/moto/include #source/gameengine/Ketsji #source/gameengine/Ketsji/KXNetwork'
incs += ' #source/blender/blenlib #source/blender/blenkernel #source/blender' incs += ' #source/blender/blenlib #source/blender/blenkernel #source/blender'
incs += ' #source/blender/editors/include #source/blender/makesdna #source/gameengine/Rasterizer' incs += ' #source/blender/editors/include #source/blender/makesdna #source/gameengine/Rasterizer'
incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer #source/gameengine/GameLogic' incs += ' #source/gameengine/GameLogic'
incs += ' #source/gameengine/Expressions #source/gameengine/Network #source/gameengine/SceneGraph' incs += ' #source/gameengine/Expressions #source/gameengine/Network #source/gameengine/SceneGraph'
incs += ' #source/gameengine/Physics/common #source/gameengine/Physics/Bullet' incs += ' #source/gameengine/Physics/common #source/gameengine/Physics/Bullet'
incs += ' #source/gameengine/Physics/Dummy' incs += ' #source/gameengine/Physics/Dummy'

View File

@@ -31,7 +31,6 @@ incs = ['.',
'#source/blender', '#source/blender',
'#source/blender/include', '#source/blender/include',
'#source/blender/makesdna', '#source/blender/makesdna',
'#source/gameengine/BlenderRoutines',
'#source/gameengine/Rasterizer', '#source/gameengine/Rasterizer',
'#source/gameengine/GameLogic', '#source/gameengine/GameLogic',
'#source/gameengine/Expressions', '#source/gameengine/Expressions',

View File

@@ -26,7 +26,6 @@ incs = ['.',
'#source/blender/include', '#source/blender/include',
'#source/blender/makesdna', '#source/blender/makesdna',
'#source/blender/makesrna', '#source/blender/makesrna',
'#source/gameengine/BlenderRoutines',
'#source/gameengine/Rasterizer', '#source/gameengine/Rasterizer',
'#source/gameengine/GameLogic', '#source/gameengine/GameLogic',
'#source/gameengine/Expressions', '#source/gameengine/Expressions',

View File

@@ -8,7 +8,7 @@ defs = [ 'GLEW_STATIC' ]
incs = '. #intern/string #intern/moto/include #source/gameengine/Rasterizer #source/gameengine/BlenderRoutines ' incs = '. #intern/string #intern/moto/include #source/gameengine/Rasterizer #source/gameengine/BlenderRoutines '
incs += ' #intern/container #source/blender/gpu #extern/glew/include ' + env['BF_OPENGL_INC'] incs += ' #intern/container #source/blender/gpu #extern/glew/include ' + env['BF_OPENGL_INC']
incs += ' #source/blender/gameengine/Ketsji #source/gameengine/SceneGraph #source/blender/makesdna #source/blender/blenkernel' incs += ' #source/blender/gameengine/Ketsji #source/gameengine/SceneGraph #source/blender/makesdna #source/blender/blenkernel'
incs += ' #intern/guardedalloc #source/blender/blenlib #source/gameengine/BlenderRoutines' incs += ' #intern/guardedalloc #source/blender/blenlib'
if env['WITH_BF_CXX_GUARDEDALLOC']: if env['WITH_BF_CXX_GUARDEDALLOC']:
defs.append('WITH_CXX_GUARDEDALLOC') defs.append('WITH_CXX_GUARDEDALLOC')