diff options
author | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-21 20:24:56 +0000 |
---|---|---|
committer | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-21 20:24:56 +0000 |
commit | 4c75444536c32d6f57801ab73129e90b93db0605 (patch) | |
tree | cf468f03b60942cbccd8a166713cf39a610f0131 /build | |
parent | ad11a576675dba34fe8f84f2abe6d1fed793b874 (diff) | |
download | chromium_src-4c75444536c32d6f57801ab73129e90b93db0605.zip chromium_src-4c75444536c32d6f57801ab73129e90b93db0605.tar.gz chromium_src-4c75444536c32d6f57801ab73129e90b93db0605.tar.bz2 |
SCons renaming updates for base, net and googleurl:
* Rename SConscript files to {module}.scons or {moduel}_lib.scons,
depending on the primary target involved.
* Separate targets into individual *.scons files, with one
construction environment (named "env") per *.scons file.
* Add using_{module}.scons files (like .vsprops) that will be used
by other modules to add CPPDEFINES, CPPPATH, LIBS and LIBPATH values.
* Update other modules' *.scons files to use the new using_{module}.scons
files (using a temporary one-liner idiom until we have the
ApplySConscript() method from the Hammer modules).
* Use the idiom of removing to-be-ported files from the master list,
so they can be simply deleted from the to-be-ported list as they
get ported in the future, instead of having to shuffle entries
between lists.
* Use $OBJ_ROOT instead of hard-coded '#/$BUILD_TYPE/' for the $*_DIR
variables.
* Add a addRepository() call mapping build/ to $TARGET_ROOT/googleurl,
so its $OBJ_ROOT value can look like the others'.
* Formatting changes, primarily modifying indentation to conform to
style guidelines.
* Fix copyright headers in some third_party/* modules
previously overlooked.
* Add rudimentary __doc__ strings, setting up for a future
ability to generate meaningful documentation.
Review URL: http://codereview.chromium.org/7807
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3675 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r-- | build/SConscript.googleurl | 95 | ||||
-rw-r--r-- | build/SConscript.main | 36 | ||||
-rw-r--r-- | build/googleurl.scons | 18 | ||||
-rw-r--r-- | build/googleurl_lib.scons | 49 | ||||
-rw-r--r-- | build/googleurl_unittests.scons | 45 | ||||
-rw-r--r-- | build/using_googleurl.scons | 15 |
6 files changed, 141 insertions, 117 deletions
diff --git a/build/SConscript.googleurl b/build/SConscript.googleurl index 11ca7c7..e69de29 100644 --- a/build/SConscript.googleurl +++ b/build/SConscript.googleurl @@ -1,95 +0,0 @@ -# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -Import('env') - -env = env.Clone() - -env.Prepend( - CPPPATH = [ - '$ICU38_DIR/public/common', - '$ICU38_DIR/public/i18n', - '#/..', - ], -) - -env.Append( - CPPDEFINES = [ - 'U_STATIC_IMPLEMENTATION', - ], -) - -if env['PLATFORM'] == 'win32': - env.Append( - CCFLAGS = [ - '/TP', - ], - ) - -lib_input_files = [ - 'gurl.cc', - 'url_canon_etc.cc', - 'url_canon_fileurl.cc', - 'url_canon_host.cc', - 'url_canon_icu.cc', - 'url_canon_internal.cc', - 'url_canon_ip.cc', - 'url_canon_mailtourl.cc', - 'url_canon_path.cc', - 'url_canon_pathurl.cc', - 'url_canon_query.cc', - 'url_canon_relative.cc', - 'url_canon_stdurl.cc', - 'url_parse.cc', - 'url_parse_file.cc', - 'url_util.cc', -] - -def BuildObjectFiles(environ, input_files): - obj_files = [] - for input_file in input_files: - source = '../googleurl/src/' + input_file - target = '$TARGET_ROOT/googleurl/' + input_file[:input_file.find('.cc')] - obj_files.append(environ.StaticObject(source = source, target = target)) - return obj_files - -env.ChromeStaticLibrary('$TARGET_ROOT/googleurl/googleurl', - BuildObjectFiles(env, lib_input_files)) - -env_tests = env.Clone() - -env_tests.Append( - CPPPATH = [ - '$GTEST_DIR/include', - ], - CPPDEFINES = [ - 'UNIT_TEST', - ], - LIBS = [ - 'googleurl', - 'base', - env_tests['ICU_LIBS'], # TODO(sgk): '$ICU_LIBS' when scons is fixed - 'gtest', - ] -) - -test_files = [ - 'gurl_unittest.cc', - 'url_canon_unittest.cc', - 'url_parse_unittest.cc', - 'url_util_unittest.cc', -] - -test_obj_files = BuildObjectFiles(env_tests, test_files) -# The version of gtest that googleurl uses provides a main() function; ours -# doesn't so include our own main function. -test_obj_files.append(env_tests.StaticObject(source = '../base/run_all_unittests.cc', - target = '$TARGET_ROOT/googleurl/run_all_unittests')) - -gurl_unittests = env_tests.ChromeTestProgram( - '$TARGET_ROOT/googleurl/googleurl_unittests', test_obj_files) - -installed_gurl_unittests = env.Install('$TARGET_ROOT', gurl_unittests) - -env.Alias('googleurl', installed_gurl_unittests) diff --git a/build/SConscript.main b/build/SConscript.main index a740553..f8e6882 100644 --- a/build/SConscript.main +++ b/build/SConscript.main @@ -15,6 +15,7 @@ elif p == 'name': default_warnings = ['no-missing-sconscript', 'no-no-parallel-support'] +default_warnings = ['no-no-parallel-support'] SetOption('warn', default_warnings + GetOption('warn')) @@ -29,6 +30,7 @@ env = Environment( BUILD_TYPE = ARGUMENTS.get('BUILD_TYPE', 'Hammer'), TARGET_ROOT = '#/$BUILD_TYPE', OBJ_ROOT = '$TARGET_ROOT', + ROOT_DIR = '#/..', LIBS_DIR = '$OBJ_ROOT/Libs', @@ -37,17 +39,7 @@ env = Environment( CHROME_DIR = '$OBJ_ROOT/chrome', GEARS_DIR = '$OBJ_ROOT/gears', GOOGLE_UPDATE_DIR = '$OBJ_ROOT/google_update', - - # Work around a limitation (bug?) in SCons in that, when we build - # from a different directory, it forces the build targets defined - # the SConscript.googleurl file to be relative to that file (i.e., - # here in the build/ directory with us), not relative to the - # the SConstruct directory from which SCons was launched. When - # we roll forward to a version of SCons that fixes this, we'll - # need to revert to the $BUILD_TYPE definition of GOOGLEURL_DIR. - #GOOGLEURL_DIR = '$OBJ_ROOT/googleurl', - GOOGLEURL_DIR = '#/../build/googleurl', - + GOOGLEURL_DIR = '$OBJ_ROOT/googleurl', NET_DIR = '$OBJ_ROOT/net', RLZ_DIR = '$OBJ_ROOT/rlz', SANDBOX_DIR = '$OBJ_ROOT/sandbox', @@ -464,8 +456,8 @@ env.Decider('MD5-timestamp') # Overlay things from a layer below. -env.Dir('$TARGET_ROOT').addRepository(Dir('..')) - +env.Dir('$TARGET_ROOT').addRepository(Dir('#/..')) +env.Dir('$TARGET_ROOT/googleurl').addRepository(env.Dir('$ROOT_DIR/build')) included = [c for c in load if not c.startswith('-')] excluded = [c[1:] for c in load if c.startswith('-')] @@ -483,7 +475,7 @@ def LoadComponent(c): sconscripts = [] if LoadComponent('base'): - sconscripts.append('$BASE_DIR/SConscript') + sconscripts.append('$BASE_DIR/base.scons') if LoadComponent('breakpad'): sconscripts.append('$BREAKPAD_DIR/SConscript') @@ -500,10 +492,10 @@ if LoadComponent('google_update'): if LoadComponent('googleurl'): # googleurl comes from a different repository so we provide the SConscript # file. - sconscripts.append('SConscript.googleurl') + sconscripts.append('$GOOGLEURL_DIR/googleurl.scons') if LoadComponent('net'): - sconscripts.append('$NET_DIR/SConscript') + sconscripts.append('$NET_DIR/net.scons') if LoadComponent('rlz'): sconscripts.append('$RLZ_DIR/SConscript') @@ -523,12 +515,12 @@ if LoadComponent('testing'): if LoadComponent('third_party'): sconscripts.extend([ '$BSDIFF_DIR/SConscript', - '$BZIP2_DIR/SConscript', - '$ICU38_DIR/SConscript', - '$LIBPNG_DIR/SConscript', + '$BZIP2_DIR/bzip2.scons', + '$ICU38_DIR/icu38.scons', + '$LIBPNG_DIR/libpng.scons', '$LZMA_SDK_DIR/SConscript', - '$MODP_B64_DIR/SConscript', - '$ZLIB_DIR/SConscript', + '$MODP_B64_DIR/modp_b64.scons', + '$ZLIB_DIR/zlib.scons', ]) # Temporary until we get these building on Mac. if env['PLATFORM'] != 'darwin': @@ -539,7 +531,7 @@ if LoadComponent('third_party'): ]) if env['PLATFORM'] in ('posix', 'darwin'): sconscripts.extend([ - '$LIBEVENT_DIR/SConscript', + '$LIBEVENT_DIR/libevent.scons', ]) # This is temporary until we get this lib to build on other platforms. if env['PLATFORM'] == 'win32': diff --git a/build/googleurl.scons b/build/googleurl.scons new file mode 100644 index 0000000..fffb4fd --- /dev/null +++ b/build/googleurl.scons @@ -0,0 +1,18 @@ +# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +__doc__ = """ +Master configuration for building googleurl components. +""" + +Import('env') + +sconscript_files = [ + 'googleurl_lib.scons', + 'googleurl_unittests.scons', +] + +SConscript(sconscript_files, exports=['env']) + +env.Alias('base', '.') diff --git a/build/googleurl_lib.scons b/build/googleurl_lib.scons new file mode 100644 index 0000000..cbb403f --- /dev/null +++ b/build/googleurl_lib.scons @@ -0,0 +1,49 @@ +# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +__doc__ = """ +Configuration for building googleurl.lib / libgoogleurl.a. +""" + +Import('env') + +env = env.Clone() + +env.SConscript([ + '$ICU38_DIR/using_icu38.scons', +], {'env':env}) + +env.Prepend( + CPPPATH = [ + '$ROOT_DIR', + ], +) + +if env['PLATFORM'] == 'win32': + env.Append( + CCFLAGS = [ + '/TP', + ], + ) + +input_files = [ + 'src/gurl.cc', + 'src/url_canon_etc.cc', + 'src/url_canon_fileurl.cc', + 'src/url_canon_host.cc', + 'src/url_canon_icu.cc', + 'src/url_canon_internal.cc', + 'src/url_canon_ip.cc', + 'src/url_canon_mailtourl.cc', + 'src/url_canon_path.cc', + 'src/url_canon_pathurl.cc', + 'src/url_canon_query.cc', + 'src/url_canon_relative.cc', + 'src/url_canon_stdurl.cc', + 'src/url_parse.cc', + 'src/url_parse_file.cc', + 'src/url_util.cc', +] + +env.ChromeStaticLibrary('googleurl', input_files) diff --git a/build/googleurl_unittests.scons b/build/googleurl_unittests.scons new file mode 100644 index 0000000..2da2e47 --- /dev/null +++ b/build/googleurl_unittests.scons @@ -0,0 +1,45 @@ +# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +__doc__ = """ +Configuration for building the googleurl_unittests{,.exe} executable. +""" + +Import('env') + +env = env.Clone() + +env.SConscript([ + '$BASE_DIR/using_base.scons', + '$ICU38_DIR/using_icu38.scons', + '$GTEST_DIR/../using_gtest.scons', + '#/../build/using_googleurl.scons', +], {'env':env}) + +env.Prepend( + CPPPATH = [ + '$ROOT_DIR', + ], +) + +if env['PLATFORM'] == 'win32': + env.Append( + CCFLAGS = [ + '/TP', + ], + ) + +input_files = [ + 'src/gurl_unittest.cc', + 'src/url_canon_unittest.cc', + 'src/url_parse_unittest.cc', + 'src/url_util_unittest.cc', + '$OBJ_ROOT/base/run_all_unittests$OBJSUFFIX', +] + +gurl_unittests = env.ChromeTestProgram('googleurl_unittests', input_files) + +installed_gurl_unittests = env.Install('$TARGET_ROOT', gurl_unittests) + +env.Alias('googleurl', installed_gurl_unittests) diff --git a/build/using_googleurl.scons b/build/using_googleurl.scons new file mode 100644 index 0000000..3c2c3c6 --- /dev/null +++ b/build/using_googleurl.scons @@ -0,0 +1,15 @@ +# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +__doc__ = """ +Settings for other components using the googleurl library. +""" + +Import("env") + +env.Append( + LIBS = [ + 'googleurl', + ], +) |