OLD | NEW |
| (Empty) |
1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 __doc__ = """ | |
6 Configuration for building base.lib / libbase.a. | |
7 """ | |
8 | |
9 Import('env') | |
10 | |
11 env = env.Clone() | |
12 | |
13 env.ApplySConscript([ | |
14 '$ICU38_DIR/using_icu38.scons', | |
15 ]) | |
16 | |
17 if env.Bit('windows'): | |
18 env.Prepend( | |
19 CCFLAGS = [ | |
20 '/Wp64', | |
21 ], | |
22 ) | |
23 | |
24 # Add object files David M Gay's dtoa and g_fmt third party lib. We | |
25 # compile these separately so we can disable warnings. | |
26 env_dmg_fp = env.Clone() | |
27 if env_dmg_fp.Bit('windows'): | |
28 env_dmg_fp.Append( | |
29 CCFLAGS = [ | |
30 '/wd4018', | |
31 '/wd4102', | |
32 '/wd4244', | |
33 '/wd4554', | |
34 ], | |
35 ) | |
36 elif env_dmg_fp.Bit('posix'): | |
37 for var in ['CCFLAGS', 'CXXFLAGS']: | |
38 if '-Wall' in env_dmg_fp[var]: | |
39 env_dmg_fp[var].remove('-Wall') | |
40 env_dmg_fp[var].append('-Wno-write-strings') | |
41 | |
42 dtoa_cc = env_dmg_fp.ChromeObject('third_party/dmg_fp/dtoa.cc') | |
43 | |
44 g_fmt_cc = env_dmg_fp.ChromeObject('third_party/dmg_fp/g_fmt.cc') | |
45 | |
46 # Some files from this list are not yet ported. They are removed from | |
47 # the list, see code below. | |
48 input_files = ChromeFileList([ | |
49 'at_exit.cc', | |
50 'at_exit.h', | |
51 'atomic_ref_count.h', | |
52 'atomic_sequence_num.h', | |
53 'atomicops.h', | |
54 'atomicops_internals_x86_msvc.h', | |
55 'base_drag_source.cc', | |
56 'base_drag_source.h', | |
57 'base_drop_target.cc', | |
58 'base_drop_target.h', | |
59 'base_paths.cc', | |
60 'base_paths.h', | |
61 'base_paths_win.cc', | |
62 'base_paths_win.h', | |
63 'base_switches.cc', | |
64 'base_switches.h', | |
65 'basictypes.h', | |
66 'third_party/nss/blapi.h', | |
67 'third_party/nss/blapit.h', | |
68 '../build/build_config.h', | |
69 'bzip2_error_handler.cc', | |
70 'clipboard.cc', | |
71 'clipboard.h', | |
72 'clipboard_util.cc', | |
73 'clipboard_util.h', | |
74 'clipboard_win.cc', | |
75 'command_line.cc', | |
76 'command_line.h', | |
77 'compiler_specific.h', | |
78 'condition_variable.h', | |
79 'condition_variable_win.cc', | |
80 'cpu.cc', | |
81 'cpu.h', | |
82 'debug_on_start.cc', | |
83 'debug_on_start.h', | |
84 'debug_util.cc', | |
85 'debug_util.h', | |
86 'debug_util_win.cc', | |
87 'directory_watcher.h', | |
88 'directory_watcher_win.cc', | |
89 'third_party/dmg_fp/dmg_fp.h', | |
90 dtoa_cc, | |
91 'event_recorder.cc', | |
92 'event_recorder.h', | |
93 'field_trial.cc', | |
94 'field_trial.h', | |
95 'file_path.cc', | |
96 'file_path.h', | |
97 'file_util.cc', | |
98 'file_util.h', | |
99 'file_util_win.cc', | |
100 'file_version_info.cc', | |
101 'file_version_info.h', | |
102 'fix_wp64.h', | |
103 'float_util.h', | |
104 g_fmt_cc, | |
105 'hash_tables.h', | |
106 'histogram.cc', | |
107 'histogram.h', | |
108 'hmac.h', | |
109 'hmac_win.cc', | |
110 'iat_patch.cc', | |
111 'iat_patch.h', | |
112 'icu_util.cc', | |
113 'icu_util.h', | |
114 'id_map.h', | |
115 'idle_timer.cc', | |
116 'idle_timer.h', | |
117 'image_util.cc', | |
118 'image_util.h', | |
119 'json_reader.cc', | |
120 'json_reader.h', | |
121 'json_writer.cc', | |
122 'json_writer.h', | |
123 'keyboard_codes.h', | |
124 'keyboard_codes_posix.h', | |
125 'keyboard_codes_win.h', | |
126 'lazy_instance.cc', | |
127 'lazy_instance.h', | |
128 'linked_ptr.h', | |
129 'lock.cc', | |
130 'lock.h', | |
131 'lock_impl.h', | |
132 'lock_impl_win.cc', | |
133 'logging.cc', | |
134 'logging.h', | |
135 'md5.cc', | |
136 'md5.h', | |
137 'memory_debug.cc', | |
138 'memory_debug.h', | |
139 'message_loop.cc', | |
140 'message_loop.h', | |
141 'message_pump.h', | |
142 'message_pump_default.cc', | |
143 'message_pump_default.h', | |
144 'message_pump_win.cc', | |
145 'message_pump_win.h', | |
146 'non_thread_safe.cc', | |
147 'non_thread_safe.h', | |
148 'object_watcher.cc', | |
149 'object_watcher.h', | |
150 'observer_list.h', | |
151 'observer_list_threadsafe.h', | |
152 'path_service.cc', | |
153 'path_service.h', | |
154 'pe_image.cc', | |
155 'pe_image.h', | |
156 'pickle.cc', | |
157 'pickle.h', | |
158 'platform_file.h', | |
159 'platform_file_win.cc', | |
160 'platform_thread.h', | |
161 'platform_thread_win.cc', | |
162 'port.h', | |
163 'third_party/nspr/prcpucfg.h', | |
164 'third_party/nspr/prcpucfg_win.h', | |
165 'process.h', | |
166 'process_util.h', | |
167 'process_util_win.cc', | |
168 'process_win.cc', | |
169 'third_party/nspr/prtime.cc', | |
170 'third_party/nspr/prtime.h', | |
171 'third_party/nspr/prtypes.h', | |
172 'third_party/purify/pure.h', | |
173 'third_party/purify/pure_api.c', | |
174 'rand_util.cc', | |
175 'rand_util.h', | |
176 'rand_util_win.cc', | |
177 'ref_counted.cc', | |
178 'ref_counted.h', | |
179 'registry.cc', | |
180 'registry.h', | |
181 'resource_util.cc', | |
182 'resource_util.h', | |
183 'revocable_store.cc', | |
184 'revocable_store.h', | |
185 'scoped_bstr_win.cc', | |
186 'scoped_bstr_win.h', | |
187 'scoped_clipboard_writer.cc', | |
188 'scoped_clipboard_writer.h', | |
189 'scoped_comptr_win.h', | |
190 'scoped_handle.h', | |
191 'scoped_handle_win.h', | |
192 'scoped_nsautorelease_pool.h', | |
193 'scoped_ptr.h', | |
194 'scoped_temp_dir.cc', | |
195 'scoped_temp_dir.h', | |
196 'sha2.cc', | |
197 'sha2.h', | |
198 'third_party/nss/sha256.h', | |
199 'third_party/nss/sha512.cc', | |
200 'shared_memory.h', | |
201 'shared_memory_win.cc', | |
202 'simple_thread.cc', | |
203 'simple_thread.h', | |
204 'singleton.h', | |
205 'spin_wait.h', | |
206 'stack_container.h', | |
207 'stats_counters.h', | |
208 'stats_table.cc', | |
209 'stats_table.h', | |
210 'string16.h', | |
211 'string_escape.cc', | |
212 'string_escape.h', | |
213 'string_piece.cc', | |
214 'string_piece.h', | |
215 'string_tokenizer.h', | |
216 'string_util.cc', | |
217 'string_util.h', | |
218 'string_util_icu.cc', | |
219 'string_util_win.h', | |
220 'sys_info.h', | |
221 'sys_info_win.cc', | |
222 'sys_string_conversions.h', | |
223 'sys_string_conversions_win.cc', | |
224 'system_monitor.cc', | |
225 'system_monitor.h', | |
226 'system_monitor_win.cc', | |
227 'task.h', | |
228 'test_file_util.h', | |
229 'test_file_util_win.cc', | |
230 'thread.cc', | |
231 'thread.h', | |
232 'thread_collision_warner.cc', | |
233 'thread_collision_warner.h', | |
234 'thread_local.h', | |
235 'thread_local_storage.h', | |
236 'thread_local_storage_win.cc', | |
237 'thread_local_win.cc', | |
238 'time.cc', | |
239 'time.h', | |
240 'time_format.cc', | |
241 'time_format.h', | |
242 'time_win.cc', | |
243 'timer.cc', | |
244 'timer.h', | |
245 'trace_event.cc', | |
246 'trace_event.h', | |
247 'tracked.cc', | |
248 'tracked.h', | |
249 'tracked_objects.cc', | |
250 'tracked_objects.h', | |
251 'tuple.h', | |
252 'values.cc', | |
253 'values.h', | |
254 'version.cc', | |
255 'version.h', | |
256 'waitable_event.h', | |
257 'waitable_event_watcher.h', | |
258 'waitable_event_watcher_win.cc', | |
259 'waitable_event_win.cc', | |
260 'watchdog.cc', | |
261 'watchdog.h', | |
262 'win_util.cc', | |
263 'win_util.h', | |
264 'windows_message_list.h', | |
265 'wmi_util.cc', | |
266 'wmi_util.h', | |
267 'word_iterator.cc', | |
268 'word_iterator.h', | |
269 'worker_pool.cc', | |
270 'worker_pool.h', | |
271 ]) | |
272 | |
273 if env.Bit('posix'): | |
274 # Remove files that still need to be ported from the input_files list. | |
275 # TODO(port): delete files from this list as they get ported. | |
276 input_files.Remove( | |
277 'clipboard_util.cc', | |
278 'event_recorder.cc', | |
279 | |
280 # We have an implementation of idle_timer that depends on XScreenSaver, | |
281 # but it's unclear if we want it yet, so it's commented out for now. | |
282 # Leave this 'unported'. | |
283 'idle_timer.cc', | |
284 | |
285 'object_watcher.cc', | |
286 | |
287 'resource_util.cc', # Uses HMODULE, but may be abstractable. | |
288 ) | |
289 | |
290 input_files.Append( | |
291 # See above note about idle_timer.cc. | |
292 'idle_timer_none.cc', | |
293 ) | |
294 | |
295 if not env.Bit('windows'): | |
296 # Remove windows-specific files on non-Windows platforms. | |
297 # TODO(sgk): | |
298 # Remove the windows-specific files from the input_files list above | |
299 # and turn this back in to an add-on-Windows list (like we used to) | |
300 # once we're comfortable re-ordering the files in the generated | |
301 # .vcproj file(s). | |
302 input_files.Remove( | |
303 'base_drag_source.cc', | |
304 'base_drop_target.cc', | |
305 'base_paths_win.cc', | |
306 'clipboard_win.cc', | |
307 'condition_variable_win.cc', | |
308 'cpu.cc', | |
309 'debug_on_start.cc', | |
310 'debug_util_win.cc', | |
311 'directory_watcher_win.cc', | |
312 'file_util_win.cc', | |
313 'file_version_info.cc', | |
314 'hmac_win.cc', | |
315 'iat_patch.cc', | |
316 'image_util.cc', | |
317 'lock_impl_win.cc', | |
318 'message_pump_win.cc', | |
319 'pe_image.cc', | |
320 'platform_file_win.cc', | |
321 'platform_thread_win.cc', | |
322 'process_util_win.cc', | |
323 'process_win.cc', | |
324 'rand_util_win.cc', | |
325 'registry.cc', | |
326 'scoped_bstr_win.cc', | |
327 'scoped_bstr_win.h', | |
328 'scoped_comptr_win.h', | |
329 'shared_memory_win.cc', | |
330 'sys_info_win.cc', | |
331 'sys_string_conversions_win.cc', | |
332 'system_monitor_win.cc', | |
333 'test_file_util_win.cc', | |
334 'thread_local_storage_win.cc', | |
335 'thread_local_win.cc', | |
336 'third_party/purify/pure_api.c', | |
337 'time_win.cc', | |
338 'waitable_event_win.cc', | |
339 'waitable_event_watcher_win.cc', | |
340 'win_util.cc', | |
341 'wmi_util.cc', | |
342 'worker_pool.cc', | |
343 ) | |
344 | |
345 if env.Bit('posix'): | |
346 input_files.Extend([ | |
347 'condition_variable_posix.cc', | |
348 'debug_util_posix.cc', | |
349 'file_util_posix.cc', | |
350 'lock_impl_posix.cc', | |
351 'message_pump_libevent.cc', | |
352 'platform_file_posix.cc', | |
353 'platform_thread_posix.cc', | |
354 'process_util_posix.cc', | |
355 'rand_util_posix.cc', | |
356 'shared_memory_posix.cc', | |
357 'string16.cc', | |
358 'sys_info_posix.cc', | |
359 'system_monitor_posix.cc', | |
360 'thread_local_storage_posix.cc', | |
361 'thread_local_posix.cc', | |
362 'time_posix.cc', | |
363 'waitable_event_posix.cc', | |
364 'waitable_event_watcher_posix.cc', | |
365 ]) | |
366 | |
367 if env.Bit('mac'): | |
368 input_files.Extend([ | |
369 'base_paths_mac.mm', | |
370 'event_recorder_stubs.cc', | |
371 'clipboard_mac.mm', | |
372 'file_util_mac.mm', | |
373 'file_version_info_mac.mm', | |
374 'hmac_mac.cc', | |
375 'mac_util.mm', | |
376 'message_pump_mac.mm', | |
377 'platform_thread_mac.mm', | |
378 'scoped_nsautorelease_pool.mm', | |
379 'sys_string_conversions_mac.mm', | |
380 'test_file_util_mac.cc', | |
381 'worker_pool_mac.mm', | |
382 ]) | |
383 | |
384 if env.Bit('linux'): | |
385 input_files.Extend([ | |
386 'atomicops_internals_x86_gcc.cc', | |
387 'base_paths_linux.cc', | |
388 'clipboard_linux.cc', | |
389 'data_pack.cc', | |
390 'event_recorder_stubs.cc', | |
391 'file_util_linux.cc', | |
392 'file_version_info_linux.cc', | |
393 'hmac_nss.cc', | |
394 'message_pump_glib.cc', | |
395 'nss_init.cc', | |
396 'process_posix.cc', | |
397 'process_util_linux.cc', | |
398 'sys_string_conversions_linux.cc', | |
399 'test_file_util_linux.cc', | |
400 'worker_pool.cc', | |
401 ]) | |
402 | |
403 env.ChromeLibrary('base', input_files) | |
404 | |
405 p = env.ChromeMSVSProject('build/base.vcproj', | |
406 dest='$CHROME_SRC_DIR/base/build/base.vcproj', | |
407 guid='{1832A374-8A74-4F9E-B536-69A699B3E165}', | |
408 keyword='Win32Proj', | |
409 dependencies=[ | |
410 'build/debug_message.vcproj', | |
411 # Necessary for chrome.sln. | |
412 '$ICU38_DIR/build/icu.vcproj', | |
413 ], | |
414 files=input_files, | |
415 tools=[ | |
416 'VCPreBuildEventTool', | |
417 'VCCustomBuildTool', | |
418 'VCXMLDataGeneratorTool', | |
419 'VCWebServiceProxyGeneratorTool', | |
420 'VCMIDLTool', | |
421 'VCCLCompilerTool', | |
422 'VCManagedResourceCompilerTool', | |
423 'VCResourceCompilerTool', | |
424 'VCPreLinkEventTool', | |
425 'VCLibrarianTool', | |
426 'VCALinkTool', | |
427 'VCXDCMakeTool', | |
428 'VCBscMakeTool', | |
429 'VCFxCopTool', | |
430 'VCPostBuildEventTool', | |
431 ]) | |
432 | |
433 p.AddConfig('Debug|Win32', | |
434 ConfigurationType = '4', | |
435 InheritedPropertySheets = [ | |
436 '$(SolutionDir)../build/debug.vsprops', | |
437 './base.vsprops', | |
438 ]) | |
439 | |
440 p.AddConfig('Release|Win32', | |
441 ConfigurationType = '4', | |
442 InheritedPropertySheets = [ | |
443 '$(SolutionDir)../build/release.vsprops', | |
444 './base.vsprops', | |
445 ]) | |
446 | |
447 p.AddFileConfig( | |
448 'third_party/dmg_fp/dtoa.cc', | |
449 'Debug|Win32', | |
450 tools=[ | |
451 MSVSTool('VCCLCompilerTool', | |
452 DisableSpecificWarnings='4244;4554;4018;4102'), | |
453 ]) | |
454 | |
455 p.AddFileConfig( | |
456 'third_party/dmg_fp/dtoa.cc', | |
457 'Release|Win32', | |
458 tools=[ | |
459 MSVSTool('VCCLCompilerTool', | |
460 DisableSpecificWarnings='4244;4554;4018;4102'), | |
461 ]) | |
462 | |
463 p.AddFileConfig( | |
464 'third_party/dmg_fp/g_fmt.cc', | |
465 'Debug|Win32', | |
466 tools=[ | |
467 MSVSTool('VCCLCompilerTool', DisableSpecificWarnings='4102'), | |
468 ]) | |
469 | |
470 p.AddFileConfig( | |
471 'third_party/dmg_fp/g_fmt.cc', | |
472 'Release|Win32', | |
473 tools=[ | |
474 MSVSTool('VCCLCompilerTool', DisableSpecificWarnings='4102'), | |
475 ]) | |
OLD | NEW |