0

Make better (and more efficient) use of Hammer functionality

in base, net and sandbox:
* Remove by-hand Install() and Alias() calls.
* Set $COMPONENT_PROGRAM_GROUPS and $COMPONENT_TEST_PROGRAM_GROUPS
  (with in each foo\foo.scons file) so executables get added
  automatically to the appropriate Alias.
* Set $TESTS_DIR and $STAGING_DIR so executables get linked
  directly in their final resting place ($TARGET_ROOT).
Review URL: http://codereview.chromium.org/9188

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4805 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
sgk@google.com
2008-11-05 19:48:25 +00:00
parent 89ac46c97e
commit 2516153bbd
13 changed files with 37 additions and 43 deletions

@ -8,6 +8,12 @@ Master configuration for building base components (including base_gfx).
Import('env')
# Arrange for Hammer to add all programs to the 'base' Alias.
env.Append(
COMPONENT_PROGRAM_GROUPS = ['base'],
COMPONENT_TEST_PROGRAM_GROUPS = ['base'],
)
sconscript_files = [
'base_lib.scons',
'base_unittests.scons',

@ -192,5 +192,4 @@ if env['PLATFORM'] == 'posix':
'worker_pool.cc',
])
base_lib = env.ChromeStaticLibrary('base', input_files)
env.Alias('base', base_lib)
env.ChromeStaticLibrary('base', input_files)

@ -172,12 +172,7 @@ if env['PLATFORM'] == 'darwin':
'platform_test_mac.mm',
])
base_unittests = env.ChromeTestProgram('base_unittests', input_files)
# Install up a level to allow unit test path assumptions to be valid.
installed_base_unittests = env.Install('$TARGET_ROOT', base_unittests)
env.Alias('base', installed_base_unittests)
env.ChromeTestProgram('base_unittests', input_files)
# TODO(sgk) should this be moved into base.lib like everything else? This will
# require updating a bunch of other SConscripts which link directly against

@ -28,12 +28,25 @@ else:
root_env = Environment(
tools = ['component_setup'],
CHROME_SRC_DIR = '$MAIN_DIR/..',
DESTINATION_ROOT = '$MAIN_DIR/Hammer',
TARGET_ROOT = '$DESTINATION_ROOT',
# Where ComponentTestProgram() will build test executables.
TESTS_DIR = '$TARGET_ROOT',
# Where ComponentProgram() will build program executables.
STAGING_DIR = '$TARGET_ROOT',
# Where ComponentLibrary() will build libraries.
LIBS_DIR = '$COMPONENT_LIBRARY_DIR',
# TODO(hammer): when Hammer supports this...
# Have Hammer prefix all Library aliases with lib_ (to avoid
# collisions with the component names themselves).
#COMPONENT_LIBRARY_ALIAS = 'lib_$LIBNAME',
# Disable running of tests thru scons for now.
COMPONENT_TEST_CMDLINE = '',

@ -14,5 +14,3 @@ sconscript_files = [
]
SConscript(sconscript_files, exports=['env'])
env.Alias('base', '.')

@ -57,8 +57,4 @@ input_files = [
if env['PLATFORM'] in ('posix', 'win32'):
crash_cache = env.ChromeTestProgram('crash_cache', input_files)
installed_test = env.Install('$TARGET_ROOT', crash_cache)
env.Alias('net', installed_test)
env.ChromeTestProgram('crash_cache', input_files)

@ -8,6 +8,12 @@ Master configuration for building net components.
Import('env')
# Arrange for Hammer to add all programs to the 'net' Alias.
env.Append(
COMPONENT_PROGRAM_GROUPS = ['net'],
COMPONENT_TEST_PROGRAM_GROUPS = ['net'],
)
sconscript_files = [
'crash_cache.scons',
'net_lib.scons',
@ -35,5 +41,3 @@ if env['PLATFORM'] == 'win32':
])
SConscript(sconscript_files, exports=['env'])
env.Alias('net', '.')

@ -69,8 +69,4 @@ input_files = [
if env['PLATFORM'] in ('posix', 'win32'):
net_perftests = env.ChromeTestProgram('net_perftests', input_files)
installed_test = env.Install('$TARGET_ROOT', net_perftests)
env.Alias('net', installed_test)
env.ChromeTestProgram('net_perftests', input_files)

@ -36,6 +36,4 @@ rc = env.Command('net_resources.rc',
env.Depends(rc, tld_names_clean)
net_resources = env.RES(rc)
env.Alias('net', net_resources)
env.RES(rc)

@ -129,8 +129,4 @@ if env['PLATFORM'] in ('darwin', 'posix'):
'base/ssl_client_socket_unittest.cc',
])
net_unittests = env.ChromeTestProgram('net_unittests', input_files)
installed_test = env.Install('$TARGET_ROOT', net_unittests)
env.Alias('net', installed_test)
env.ChromeTestProgram('net_unittests', input_files)

@ -55,8 +55,4 @@ input_files = [
]
if env['PLATFORM'] == 'win32':
stress_cache = env.ChromeTestProgram('stress_cache', input_files)
installed_test = env.Install('$TARGET_ROOT', stress_cache)
env.Alias('net', installed_test)
env.ChromeTestProgram('stress_cache', input_files)

@ -49,6 +49,4 @@ input_files = [
'tld_cleanup.cc',
]
tld_cleanup = env.ChromeProgram('tld_cleanup', input_files)
i = env.Install('$TARGET_ROOT', tld_cleanup)
env.Alias('net', i)
env.ChromeProgram('tld_cleanup', input_files)

@ -8,11 +8,10 @@ Master configuration for building base components (including base_gfx).
Import('env')
env = env.Clone(
#TESTS_DIR = '../tests',
#INTEGRATION_TESTS_DIR = '$TESTS_DIR/integration_tests',
#UNIT_TESTS_DIR = '$TESTS_DIR/unit_tests',
#VALIDATION_TESTS_DIR = '$TESTS_DIR/validation_tests',
# Arrange for Hammer to add all programs to the 'sandbox' Alias.
env.Append(
COMPONENT_PROGRAM_GROUPS = ['sandbox'],
COMPONENT_TEST_PROGRAM_GROUPS = ['sandbox'],
)
sconscript_files = [