summaryrefslogtreecommitdiffstats
path: root/site_scons/site_tools/chromium_builders.py
blob: 01b8fcce49fe3888a474962fb72e03547f83ba8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# 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.

"""
Tool module for adding, to a construction environment, Chromium-specific
wrappers around Hammer builders.  This gives us a central place for any
customization we need to make to the different things we build.
"""

def generate(env):
  def ChromeProgram(env, *args, **kw):
    result = env.ComponentProgram(*args, **kw)
    if env.get('INCREMENTAL'):
      env.Precious(result)
    return result
  env.AddMethod(ChromeProgram)

  def ChromeTestProgram(env, *args, **kw):
    result = env.ComponentTestProgram(*args, **kw)
    if env.get('INCREMENTAL'):
      env.Precious(*result)
    return result
  env.AddMethod(ChromeTestProgram)

  def ChromeStaticLibrary(env, *args, **kw):
    kw['COMPONENT_STATIC'] = True
    return env.ComponentLibrary(*args, **kw)
  env.AddMethod(ChromeStaticLibrary)

  def ChromeSharedLibrary(env, *args, **kw):
    kw['COMPONENT_STATIC'] = False
    result = [env.ComponentLibrary(*args, **kw)[0]]
    if env.get('INCREMENTAL'):
      env.Precious(result)
    return result
  env.AddMethod(ChromeSharedLibrary)

  def ChromeObject(env, *args, **kw):
    return env.ComponentObject(*args, **kw)
  env.AddMethod(ChromeObject)

  def ChromeMSVSFolder(env, *args, **kw):
    if env.Bit('msvs'):
      return env.MSVSFolder(*args, **kw)
    return []
  env.AddMethod(ChromeMSVSFolder)

  def ChromeMSVSProject(env, *args, **kw):
    if env.Bit('msvs'):
      return env.MSVSProject(*args, **kw)
    return []
  env.AddMethod(ChromeMSVSProject)

  def ChromeMSVSSolution(env, *args, **kw):
    if env.Bit('msvs'):
      return env.MSVSSolution(*args, **kw)
    return []
  env.AddMethod(ChromeMSVSSolution)

def exists(env):
  return True