Clean up libtcod_sources dict.
@@ -335,14 +335,31 @@ if 'NO_OPENGL' not in env['CPPDEFINES']:
else:
env_libtcod.Append(LIBS=['GL'])
+# Which source files to compile into the main libtcod shared library.
+# libtcod-gui sources are not included here.
libtcod_sources = {
- 'auto': (env.FilteredGlob('$VARIANT/src/*.c*',
- omit=['libtcod_c.c','libtcod.cpp'])
- + env.Glob('$VARIANT/src/*/*.c')),
- 'static': (env.Glob('$VARIANT/src/zlib/*.c')
+ # Compiles all source files under src/ with some exceptions.
+ 'auto': (
+ env.FilteredGlob(
+ # All .c and .cpp sources in src/
+ '$VARIANT/src/*.c*',
+ # Except the composite sources.
+ omit=['libtcod_c.c', 'libtcod.cpp'],
+ )
+ # Vendor sources.
+ + env.Glob('$VARIANT/src/*/*.c'),
+ ),
+ # libtcod_c.c and libtcod.cpp are helper sources that include all other
+ # files needed to build libtcod.
+ 'static': (
+ # Bundle zlib sources.
+ env.Glob('$VARIANT/src/zlib/*.c')
+ # Bundle lodepng.
+ + ['$VARIANT/src/png/lodepng.c']
+ # All other dependences are in the composite sources.
+ ['$VARIANT/src/libtcod_c.c',
- '$VARIANT/src/libtcod.cpp',
- '$VARIANT/src/png/lodepng.c']),
+ '$VARIANT/src/libtcod.cpp'],
+ ),
}
libtcod = env_libtcod.SharedLibrary(
