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