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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
|
# 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 base.lib / libbase.a.
"""
Import('env')
env = env.Clone()
env.ApplySConscript([
'$ICU38_DIR/using_icu38.scons',
])
if env.Bit('windows'):
env.Prepend(
CCFLAGS = [
'/Wp64',
],
)
# Add object files David M Gay's dtoa and g_fmt third party lib. We
# compile these separately so we can disable warnings.
env_dmg_fp = env.Clone()
if env_dmg_fp.Bit('windows'):
env_dmg_fp.Append(
CCFLAGS = [
'/wd4018',
'/wd4102',
'/wd4244',
'/wd4554',
],
)
elif env_dmg_fp.Bit('posix'):
for var in ['CCFLAGS', 'CXXFLAGS']:
if '-Wall' in env_dmg_fp[var]:
env_dmg_fp[var].remove('-Wall')
env_dmg_fp[var].append('-Wno-write-strings')
dtoa_cc = env_dmg_fp.ChromeObject('third_party/dmg_fp/dtoa.cc')
g_fmt_cc = env_dmg_fp.ChromeObject('third_party/dmg_fp/g_fmt.cc')
# Some files from this list are not yet ported. They are removed from
# the list, see code below.
input_files = ChromeFileList([
'at_exit.cc',
'at_exit.h',
'atomic_ref_count.h',
'atomic_sequence_num.h',
'atomicops.h',
'atomicops_internals_x86_msvc.h',
'base_drag_source.cc',
'base_drag_source.h',
'base_drop_target.cc',
'base_drop_target.h',
'base_paths.cc',
'base_paths.h',
'base_paths_win.cc',
'base_paths_win.h',
'base_switches.cc',
'base_switches.h',
'basictypes.h',
'third_party/nss/blapi.h',
'third_party/nss/blapit.h',
'../build/build_config.h',
'bzip2_error_handler.cc',
'clipboard.cc',
'clipboard.h',
'clipboard_util.cc',
'clipboard_util.h',
'clipboard_win.cc',
'command_line.cc',
'command_line.h',
'compiler_specific.h',
'condition_variable.h',
'condition_variable_win.cc',
'cpu.cc',
'cpu.h',
'debug_on_start.cc',
'debug_on_start.h',
'debug_util.cc',
'debug_util.h',
'debug_util_win.cc',
'directory_watcher.h',
'directory_watcher_win.cc',
'third_party/dmg_fp/dmg_fp.h',
dtoa_cc,
'event_recorder.cc',
'event_recorder.h',
'field_trial.cc',
'field_trial.h',
'file_path.cc',
'file_path.h',
'file_util.cc',
'file_util.h',
'file_util_win.cc',
'file_version_info.cc',
'file_version_info.h',
'fix_wp64.h',
'float_util.h',
g_fmt_cc,
'hash_tables.h',
'histogram.cc',
'histogram.h',
'hmac.h',
'hmac_win.cc',
'iat_patch.cc',
'iat_patch.h',
'icu_util.cc',
'icu_util.h',
'id_map.h',
'idle_timer.cc',
'idle_timer.h',
'image_util.cc',
'image_util.h',
'json_reader.cc',
'json_reader.h',
'json_writer.cc',
'json_writer.h',
'lazy_instance.cc',
'lazy_instance.h',
'linked_ptr.h',
'lock.cc',
'lock.h',
'lock_impl.h',
'lock_impl_win.cc',
'logging.cc',
'logging.h',
'md5.cc',
'md5.h',
'memory_debug.cc',
'memory_debug.h',
'message_loop.cc',
'message_loop.h',
'message_pump.h',
'message_pump_default.cc',
'message_pump_default.h',
'message_pump_win.cc',
'message_pump_win.h',
'non_thread_safe.cc',
'non_thread_safe.h',
'object_watcher.cc',
'object_watcher.h',
'observer_list.h',
'observer_list_threadsafe.h',
'path_service.cc',
'path_service.h',
'pe_image.cc',
'pe_image.h',
'pickle.cc',
'pickle.h',
'platform_file.h',
'platform_file_win.cc',
'platform_thread.h',
'platform_thread_win.cc',
'port.h',
'third_party/nspr/prcpucfg.h',
'third_party/nspr/prcpucfg_win.h',
'process.h',
'process_util.h',
'process_util_win.cc',
'process_win.cc',
'third_party/nspr/prtime.cc',
'third_party/nspr/prtime.h',
'third_party/nspr/prtypes.h',
'third_party/purify/pure.h',
'third_party/purify/pure_api.c',
'rand_util.cc',
'rand_util.h',
'rand_util_win.cc',
'ref_counted.cc',
'ref_counted.h',
'registry.cc',
'registry.h',
'resource_util.cc',
'resource_util.h',
'revocable_store.cc',
'revocable_store.h',
'scoped_clipboard_writer.cc',
'scoped_clipboard_writer.h',
'scoped_handle.h',
'scoped_nsautorelease_pool.h',
'scoped_ptr.h',
'sha2.cc',
'sha2.h',
'third_party/nss/sha256.h',
'third_party/nss/sha512.cc',
'shared_memory.h',
'shared_memory_win.cc',
'simple_thread.cc',
'simple_thread.h',
'singleton.h',
'spin_wait.h',
'stack_container.h',
'stats_counters.h',
'stats_table.cc',
'stats_table.h',
'string16.h',
'string_escape.cc',
'string_escape.h',
'string_piece.cc',
'string_piece.h',
'string_tokenizer.h',
'string_util.cc',
'string_util.h',
'string_util_icu.cc',
'string_util_win.h',
'sys_info.h',
'sys_info_win.cc',
'sys_string_conversions.h',
'sys_string_conversions_win.cc',
'system_monitor.cc',
'system_monitor.h',
'system_monitor_win.cc',
'task.h',
'test_file_util_win.cc',
'test_file_util.h',
'thread.cc',
'thread.h',
'thread_collision_warner.cc',
'thread_collision_warner.h',
'thread_local.h',
'thread_local_storage.h',
'thread_local_storage_win.cc',
'thread_local_win.cc',
'time.cc',
'time.h',
'time_format.cc',
'time_format.h',
'time_win.cc',
'timer.cc',
'timer.h',
'trace_event.cc',
'trace_event.h',
'tracked.cc',
'tracked.h',
'tracked_objects.cc',
'tracked_objects.h',
'tuple.h',
'values.cc',
'values.h',
'waitable_event.h',
'waitable_event_win.cc',
'watchdog.cc',
'watchdog.h',
'win_util.cc',
'win_util.h',
'windows_message_list.h',
'wmi_util.cc',
'wmi_util.h',
'word_iterator.cc',
'word_iterator.h',
'worker_pool.cc',
'worker_pool.h',
])
if env.Bit('posix'):
# Remove files that still need to be ported from the input_files list.
# TODO(port): delete files from this list as they get ported.
input_files.Remove(
'clipboard_util.cc',
'event_recorder.cc',
'file_version_info.cc',
# We have an implementation of idle_timer, but it's unclear if we want it
# yet, so it's commented out for now. Leave this 'unported'.
'idle_timer.cc',
'object_watcher.cc',
'resource_util.cc', # Uses HMODULE, but may be abstractable.
)
if not env.Bit('windows'):
# Remove windows-specific files on non-Windows platforms.
# TODO(sgk):
# Remove the windows-specific files from the input_files list above
# and turn this back in to an add-on-Windows list (like we used to)
# once we're comfortable re-ordering the files in the generated
# .vcproj file(s).
input_files.Remove(
'base_drag_source.cc',
'base_drop_target.cc',
'base_paths_win.cc',
'clipboard_win.cc',
'condition_variable_win.cc',
'cpu.cc',
'debug_on_start.cc',
'debug_util_win.cc',
'directory_watcher_win.cc',
'file_util_win.cc',
'hmac_win.cc',
'iat_patch.cc',
'image_util.cc',
'lock_impl_win.cc',
'message_pump_win.cc',
'pe_image.cc',
'platform_file_win.cc',
'platform_thread_win.cc',
'process_util_win.cc',
'process_win.cc',
'rand_util_win.cc',
'registry.cc',
'shared_memory_win.cc',
'sys_info_win.cc',
'sys_string_conversions_win.cc',
'system_monitor_win.cc',
'test_file_util_win.cc',
'thread_local_storage_win.cc',
'thread_local_win.cc',
'third_party/purify/pure_api.c',
'time_win.cc',
'waitable_event_win.cc',
'win_util.cc',
'wmi_util.cc',
'worker_pool.cc',
)
if env.Bit('posix'):
input_files.Extend([
'condition_variable_posix.cc',
'debug_util_posix.cc',
'file_util_posix.cc',
'lock_impl_posix.cc',
'message_pump_libevent.cc',
'platform_file_posix.cc',
'platform_thread_posix.cc',
'process_util_posix.cc',
'rand_util_posix.cc',
'shared_memory_posix.cc',
'string16.cc',
'sys_info_posix.cc',
'system_monitor_posix.cc',
'thread_local_storage_posix.cc',
'thread_local_posix.cc',
'time_posix.cc',
'waitable_event_generic.cc',
])
if env.Bit('mac'):
input_files.Extend([
'base_paths_mac.mm',
'clipboard_mac.mm',
'file_util_mac.mm',
'file_version_info_mac.mm',
'hmac_mac.cc',
'mac_util.mm',
'message_pump_mac.mm',
'platform_thread_mac.mm',
'scoped_nsautorelease_pool.mm',
'sys_string_conversions_mac.mm',
'test_file_util_mac.cc',
'worker_pool_mac.mm',
])
if env.Bit('linux'):
input_files.Extend([
'atomicops_internals_x86_gcc.cc',
'base_paths_linux.cc',
'clipboard_linux.cc',
'file_util_linux.cc',
'file_version_info_linux.cc',
'hmac_nss.cc',
'message_pump_glib.cc',
'nss_init.cc',
'process_posix.cc',
'process_util_linux.cc',
'sys_string_conversions_linux.cc',
'test_file_util_linux.cc',
'worker_pool.cc',
])
env.ChromeStaticLibrary('base', input_files)
p = env.ChromeMSVSProject('build/base.vcproj',
guid='{1832A374-8A74-4F9E-B536-69A699B3E165}',
dependencies=[
'build/debug_message.vcproj',
],
files=input_files,
tools=[
'VCPreBuildEventTool',
'VCCustomBuildTool',
'VCXMLDataGeneratorTool',
'VCWebServiceProxyGeneratorTool',
'VCMIDLTool',
'VCCLCompilerTool',
'VCManagedResourceCompilerTool',
'VCResourceCompilerTool',
'VCPreLinkEventTool',
'VCLibrarianTool',
'VCALinkTool',
'VCXDCMakeTool',
'VCBscMakeTool',
'VCFxCopTool',
'VCPostBuildEventTool',
])
p.AddConfig('Debug|Win32',
ConfigurationType = '4',
InheritedPropertySheets = [
'$(SolutionDir)../build/debug.vsprops',
'./base.vsprops',
])
p.AddConfig('Release|Win32',
ConfigurationType = '4',
InheritedPropertySheets = [
'$(SolutionDir)../build/release.vsprops',
'./base.vsprops',
])
p.AddFileConfig(
'third_party/dmg_fp/dtoa.cc',
'Debug|Win32',
tools=[
MSVSTool('VCCLCompilerTool',
DisableSpecificWarnings='4244;4554;4018;4102'),
])
p.AddFileConfig(
'third_party/dmg_fp/dtoa.cc',
'Release|Win32',
tools=[
MSVSTool('VCCLCompilerTool',
DisableSpecificWarnings='4244;4554;4018;4102'),
])
p.AddFileConfig(
'third_party/dmg_fp/g_fmt.cc',
'Debug|Win32',
tools=[
MSVSTool('VCCLCompilerTool', DisableSpecificWarnings='4102'),
])
p.AddFileConfig(
'third_party/dmg_fp/g_fmt.cc',
'Release|Win32',
tools=[
MSVSTool('VCCLCompilerTool', DisableSpecificWarnings='4102'),
])
env.AlwaysBuild(p)
i = env.Command('$CHROME_SRC_DIR/base/build/base.vcproj', p,
Copy('$TARGET', '$SOURCE'))
Alias('msvs', i)
|