summaryrefslogtreecommitdiffstats
path: root/chrome/app/resources/SConscript
blob: 6b23b9c4641acd7c96b8d4894d1c0ffb57185632 (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# 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_res'])

AddTargetGroup('all_languages', 'resource dlls for languages can be built')

env_res = env_res.Clone()

env.Append(
    LINKFLAGS = [
        '/INCREMENTAL:NO',
        '/DELAYLOAD:"dwmapi.dll"',
        '/DELAYLOAD:"uxtheme.dll"',

        '/NOENTRY',
        '/BASE:"0x3CF00000"',
        '/MACHINE:X86',
        '/FIXED:No',

        '/safeseh',
        '/dynamicbase',
        '/ignore:4199',
        '/nxcompat',
    ],
    PDB = '${TARGET}.pdb',
    no_import_lib = True,       # We don't need the .lib and .exp.
)

env_res.Append(
    CPPPATH = [
        '.',
        '$CHROME_SRC_DIR/chrome/Debug/obj/chrome_dll',
        '$CHROME_SRC_DIR',
        '$CHROME_SRC_DIR/chrome/Debug/obj',
    ],
    RCFLAGS = [
        ['/l', '0x409'],
        ['/I', '$TARGET_ROOT/grit_derived_sources'],
    ],
)

env_dll = env.Clone(COMPONENT_LIBRARY_GROUPS = ['all_languages'])

locale_list = [
    'ar',
    'bg',
    'bn',
    'ca',
    'cs',
    'da',
    'de',
    'el',
    'en-GB',
    'en-US',
    'es-419',
    'es',
    'et',
    'fi',
    'fil',
    'fr',
    'gu',
    'he',
    'hi',
    'hr',
    'hu',
    'id',
    'it',
    'ja',
    'kn',
    'ko',
    'lt',
    'lv',
    'ml',
    'mr',
    'nb',
    'nl',
    'or',
    'pl',
    'pt-BR',
    'pt-PT',
    'ro',
    'ru',
    'sk',
    'sl',
    'sr',
    'sv',
    'ta',
    'te',
    'th',
    'tr',
    'uk',
    'vi',
    'zh-CN',
    'zh-TW',
]

gcs_rc = '$TARGET_ROOT/grit_derived_sources/google_chrome_strings_%s.rc'
cs_rc = '$TARGET_ROOT/grit_derived_sources/chromium_strings_%s.rc'
gr_res = '$TARGET_ROOT/grit_derived_sources/generated_resources_%s.res'
ws_res = '$TARGET_ROOT/grit_derived_sources/webkit_strings_%s.res'

locale_dlls = []

for locale in locale_list:
  res = env_res.RES('locale_settings_%s.rc' % locale)

  # TODO(sgk):  find out why this implicit dependency isn't discovered
  env.Depends(res, gcs_rc % locale)
  env.Depends(res, cs_rc % locale)

  dll = env_dll.ChromeSharedLibrary(locale,
                                    [ gr_res % locale,
                                      ws_res % locale,
                                      res ])
  locale_dlls.append(dll)

i = env.Install('$DESTINATION_ROOT/locales/', locale_dlls)
env.Alias('chrome_locales', i)