summaryrefslogtreecommitdiffstats
path: root/build/internal/essential.scons
blob: 20dfdbb0a4baf457727881420c5d027ae6a648a5 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# 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__ = """
Essential settings for Chromium builds.
"""

Import("env")

env.Append(
    CPPPATH = [
        '$CHROME_SRC_DIR',
    ],
)

if env['PLATFORM'] == 'win32':
  env.Append(
      ARFLAGS = [
          '/ignore:4221',
      ],
      CPPDEFINES = [
          ('_WIN32_WINNT', '0x0600'),
          ('WINVER', '0x0600'),
          'WIN32',
          '_WINDOWS',
          ('_HAS_EXCEPTIONS', 0),
          'NOMINMAX',
          '_CRT_RAND_S',
          'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
          'WIN32_LEAN_AND_MEAN',
          '_SECURE_ATL',
      ],
      CPPPATH = [
          '$PLATFORMSDK_VISTA/files/Include',
          '$PLATFORMSDK_VISTA/files/VC/INCLUDE',
          '$VISUAL_STUDIO/VC/atlmfc/include',
      ],
      CCFLAGS = [
          '/GR-',   # VCCLCompilerTool.RuntimeTypeInfo="false"
          '/Gs',    # VCCLCompilerTool.BufferSecurityCheck="true"
          '/Gy',    # VCCLCompilerTool.EnableFunctionLevelLinking="true"
          '/W3',    # VCCLCompilerTool.WarningLevel="3"

          # TODO(sgk):  re-enable this
          #'/WX',   # WarnAsError="true"

          # In the old Visual Studio build, we used /Zi (edit and continue),
          # VCCLComilerTool.DebugInformationFormat="3".
          #
          # /Zi ends up with multiple compiler invocations trying to updat
          # the same vc80.pdb file at the same time, with race conditions
          # and permission problems.  We're using /Z7 because it makes things
          # work even in parallel builds, without special config to avoid
          # multiple simultaneous updates the vc80.pdb file.  All the
          # debugging information and capability still end up in the
          # executables.
          '/Z7',    # VCCLCompilerTool.DebugInformationFormat="1"

          # VCCLCompilerTool.DisableSpecificWarnings="4503; 4819"
          '/wd4503',
          '/wd4819',
      ],
      LIBPATH = [
          '$PLATFORMSDK_VISTA/files/Lib',
          '$PLATFORMSDK_VISTA/files/VC/LIB',
          '$VISUAL_STUDIO/VC/atlmfc/lib',
      ],
      LIBS = [
          'msimg32',
          'psapi',
          'usp10.lib',
          'version',
          'wininet',
          'ws2_32',
      ],
      LINKFLAGS = [
          '/DEBUG',

          '/MANIFEST',
          '/DELAYLOAD:"dwmapi.dll"',
          '/DELAYLOAD:"uxtheme.dll"',
          '/MACHINE:X86',
          '/FIXED:No',

          '/safeseh',
          '/dynamicbase',
          '/ignore:4199',
          '/ignore:4221',
          '/nxcompat',
      ],
  )
  env.FilterOut(
      CCFLAGS = [
          '/GM',    # VCCLCompilerTool.MinimalRebuild="false"
          '/EH',    # VCCLCompilerTool.ExceptionHandling="0"
      ],
  )
elif env['PLATFORM'] == 'posix':
  pass
elif env['PLATFORM'] == 'mac':
  pass