summaryrefslogtreecommitdiffstats
path: root/site_scons
diff options
context:
space:
mode:
authorsgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-20 23:13:26 +0000
committersgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-20 23:13:26 +0000
commit9d384037786ac2912d2ffc82cd1718d8383d8d9f (patch)
treefc85e1d240d0b31c1dd488fcb1723133290d8291 /site_scons
parente66eaf0cc9fe5c6c17ffee01fc2d370270b9e07f (diff)
downloadchromium_src-9d384037786ac2912d2ffc82cd1718d8383d8d9f.zip
chromium_src-9d384037786ac2912d2ffc82cd1718d8383d8d9f.tar.gz
chromium_src-9d384037786ac2912d2ffc82cd1718d8383d8d9f.tar.bz2
Update the gyp Linux build:
* Add Linux settings to target_defaults in common.gypi so gyp-generated SConscript files no longer depend on build/SConscript.main or the Hammer infrastructure. * Copy the FilterOut() function from Hammer to the chromium_builders.py Tool module. * Add a ChromiumLoadableModule() builder to chromium_builders.py. * Add dependencies on the 'views' library to the chrome link (target 'app'). * Add missing views/*/*_unittest.cc modules to the 'unit_tests' target. Exclude all but the one that builds on Linux from the non-Windows builds. * Crib a list of chrome/views files to exclude from the Linux build from the old SCons configuration. * Add a new build/linux/system.gyp file with new 'settings' targets to encapsulate the pkg-config checks for gtk+-2.0, nss and pangoft2. * Add depenedencies in the other targets on the new gtk, nss and pangoft2 'settings' targets from build/linux/system.gyp. * Add a pkg_config_wrapper.py script that keeps gyp happy by simply exiting 0 if the package isn't found. * DEPS roll for latest gyp changes to support the above. Review URL: http://codereview.chromium.org/42340 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12228 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'site_scons')
-rw-r--r--site_scons/site_tools/chromium_builders.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/site_scons/site_tools/chromium_builders.py b/site_scons/site_tools/chromium_builders.py
index c1a6b077..334ac83 100644
--- a/site_scons/site_tools/chromium_builders.py
+++ b/site_scons/site_tools/chromium_builders.py
@@ -52,6 +52,38 @@ class ChromeFileList(MSVS.FileList):
else:
top[i] = new
+
+def FilterOut(self, **kw):
+ """Removes values from existing construction variables in an Environment.
+
+ The values to remove should be a list. For example:
+
+ self.FilterOut(CPPDEFINES=['REMOVE_ME', 'ME_TOO'])
+
+ Args:
+ self: Environment to alter.
+ kw: (Any other named arguments are values to remove).
+ """
+
+ kw = SCons.Environment.copy_non_reserved_keywords(kw)
+ for key, val in kw.items():
+ envval = self.get(key, None)
+ if envval is None:
+ # No existing variable in the environment, so nothing to delete.
+ continue
+
+ for vremove in val:
+ # Use while not if, so we can handle duplicates.
+ while vremove in envval:
+ envval.remove(vremove)
+
+ self[key] = envval
+
+ # TODO(sgk): SCons.Environment.Append() has much more logic to deal
+ # with various types of values. We should handle all those cases in here
+ # too. (If variable is a dict, etc.)
+
+
import __builtin__
__builtin__.ChromeFileList = ChromeFileList
@@ -119,6 +151,15 @@ def ChromeLibrary(env, target, source, *args, **kw):
result = env.ComponentLibrary(target, source, *args, **kw)
return result
+def ChromeLoadableModule(env, target, source, *args, **kw):
+ source = compilable_files(env, source)
+ if env.get('_GYP'):
+ result = env.LoadableModule(target, source, *args, **kw)
+ else:
+ kw['COMPONENT_STATIC'] = True
+ result = env.LoadableModule(target, source, *args, **kw)
+ return result
+
def ChromeStaticLibrary(env, target, source, *args, **kw):
source = compilable_files(env, source)
if env.get('_GYP'):
@@ -189,6 +230,7 @@ def generate(env):
env.AddMethod(ChromeProgram)
env.AddMethod(ChromeTestProgram)
env.AddMethod(ChromeLibrary)
+ env.AddMethod(ChromeLoadableModule)
env.AddMethod(ChromeStaticLibrary)
env.AddMethod(ChromeSharedLibrary)
env.AddMethod(ChromeObject)
@@ -196,6 +238,8 @@ def generate(env):
env.AddMethod(ChromeMSVSProject)
env.AddMethod(ChromeMSVSSolution)
+ env.AddMethod(FilterOut)
+
# Add the grit tool to the base environment because we use this a lot.
sys.path.append(env.Dir('$CHROME_SRC_DIR/tools/grit').abspath)
env.Tool('scons', toolpath=[env.Dir('$CHROME_SRC_DIR/tools/grit/grit')])