Skip to content

Commit 866eb04

Browse files
committed
Add code to skip initializing DefaultEnvironment() when it's clear it won't be used. This will significantly speed up these examples on windows
1 parent f0ca0e8 commit 866eb04

5 files changed

Lines changed: 21 additions & 5 deletions

File tree

cfile-to-asm-builder/SConstruct

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Skip initializing any tools in the DefaultEnvironment
2+
# as we're not using it.
3+
DefaultEnvironment(tools=[])
4+
15
# Create a new method to generate assembly files.
26
env=Environment()
37

shared-lib-program/SConstruct

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ env.SharedLibrary(
99
target = libname,
1010
source = 'lib.c')
1111

12-
# We list the library by it's base name 'a' and not a.dll, or liba.a because SCons
12+
# We list the library by it's base name 'xyz' and not xyz.dll, or libxyz.a because SCons
1313
# will expand this to the appropriate platform/compiler dependent file name
14-
# and use the correct arguments to the linker to link against the shared library 'a'
15-
# NOTE: We use LIBS here instead of env['LIBS']=['a'] as we're also building the
14+
# and use the correct arguments to the linker to link against the shared library 'xyz'
15+
# NOTE: We use LIBS here instead of env['LIBS']=['xyz'] as we're also building the
1616
# shared library above with the same Environment().
17-
# Having env.Prepend(LIBS=['a']) would cause the SharedLibrary() above to ALSO
18-
# try to link against shared library a. (Or on win32 file 'a.lib') and fail.
17+
# Having env.Prepend(LIBS=['xyz']) would cause the SharedLibrary() above to ALSO
18+
# try to link against shared library xyz. (Or on win32 file 'xyz.lib') and fail.
1919
env.Program(
2020
target = 'app',
2121
source = 'app.c',

simple-configure/SConstruct

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Skip initializing any tools in the DefaultEnvironment
2+
# as we're not using it.
3+
DefaultEnvironment(tools=[])
4+
15
env=Environment()
26

37
conf=Configure(env, config_h='config.h')

simple-variant-dir/SConstruct

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Skip initializing any tools in the DefaultEnvironment
2+
# as we're not using it.
3+
DefaultEnvironment(tools=[])
4+
15
env=Environment()
26

37
env['CPPPATH'] = ['#/src/liba']

simple/SConstruct

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
# Skip initializing any tools in the DefaultEnvironment
2+
# as we're not using it.
3+
DefaultEnvironment(tools=[])
4+
15
env=Environment()
26
env.Program('hello.c')

0 commit comments

Comments
 (0)