OLD | NEW |
1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 # for details. All rights reserved. Use of this source code is governed by a | 2 # for details. All rights reserved. Use of this source code is governed by a |
3 # BSD-style license that can be found in the LICENSE file. | 3 # BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 { | 5 { |
6 'variables': { | 6 'variables': { |
7 'io_cc_file': '<(SHARED_INTERMEDIATE_DIR)/io_gen.cc', | 7 # We place most generated source files in LIB_DIR (rather than, say |
8 'io_patch_cc_file': '<(SHARED_INTERMEDIATE_DIR)/io_patch_gen.cc', | 8 # SHARED_INTERMEDIATE_DIR) because it is toolset specific. This avoids |
| 9 # two problems. First, if a generated source file has architecture specific |
| 10 # code, we'll get two different files in two different directories. Second, |
| 11 # if a generated source file is needed to build a target with multiple |
| 12 # toolsets, we avoid having duplicate Makefile targets. |
| 13 'gen_source_dir': '<(LIB_DIR)', |
| 14 |
| 15 'io_cc_file': '<(gen_source_dir)/io_gen.cc', |
| 16 'io_patch_cc_file': '<(gen_source_dir)/io_patch_gen.cc', |
9 'builtin_in_cc_file': 'builtin_in.cc', | 17 'builtin_in_cc_file': 'builtin_in.cc', |
10 'builtin_cc_file': '<(SHARED_INTERMEDIATE_DIR)/builtin_gen.cc', | 18 'builtin_cc_file': '<(gen_source_dir)/builtin_gen.cc', |
11 'snapshot_in_cc_file': 'snapshot_in.cc', | 19 'snapshot_in_cc_file': 'snapshot_in.cc', |
12 'snapshot_bin_file': '<(SHARED_INTERMEDIATE_DIR)/snapshot_gen.bin', | 20 'snapshot_bin_file': '<(gen_source_dir)/snapshot_gen.bin', |
| 21 'resources_cc_file': '<(gen_source_dir)/resources_gen.cc', |
| 22 |
| 23 # The program that creates snapshot_gen.cc is only built and run on the |
| 24 # host, but it must be available when dart is built for the target. Thus, |
| 25 # we keep it in a shared location. |
13 'snapshot_cc_file': '<(SHARED_INTERMEDIATE_DIR)/snapshot_gen.cc', | 26 'snapshot_cc_file': '<(SHARED_INTERMEDIATE_DIR)/snapshot_gen.cc', |
14 'resources_cc_file': '<(SHARED_INTERMEDIATE_DIR)/resources_gen.cc', | |
15 }, | 27 }, |
16 'targets': [ | 28 'targets': [ |
17 { | 29 { |
18 'target_name': 'generate_builtin_cc_file', | 30 'target_name': 'generate_builtin_cc_file', |
19 'type': 'none', | 31 'type': 'none', |
| 32 'toolsets':['target','host'], |
20 'includes': [ | 33 'includes': [ |
21 'builtin_sources.gypi', | 34 'builtin_sources.gypi', |
22 ], | 35 ], |
23 'actions': [ | 36 'actions': [ |
24 { | 37 { |
25 'action_name': 'generate_builtin_cc', | 38 'action_name': 'generate_builtin_cc', |
26 'inputs': [ | 39 'inputs': [ |
27 '../tools/create_string_literal.py', | 40 '../tools/create_string_literal.py', |
28 '<(builtin_in_cc_file)', | 41 '<(builtin_in_cc_file)', |
29 '<@(_sources)', | 42 '<@(_sources)', |
(...skipping 10 matching lines...) Expand all Loading... |
40 '--var_name', 'Builtin::builtin_source_', | 53 '--var_name', 'Builtin::builtin_source_', |
41 '<@(_sources)', | 54 '<@(_sources)', |
42 ], | 55 ], |
43 'message': 'Generating ''<(builtin_cc_file)'' file.' | 56 'message': 'Generating ''<(builtin_cc_file)'' file.' |
44 }, | 57 }, |
45 ] | 58 ] |
46 }, | 59 }, |
47 { | 60 { |
48 'target_name': 'generate_io_cc_file', | 61 'target_name': 'generate_io_cc_file', |
49 'type': 'none', | 62 'type': 'none', |
| 63 'toolsets':['target','host'], |
50 'variables': { | 64 'variables': { |
51 'io_dart': '<(SHARED_INTERMEDIATE_DIR)/io_gen.dart', | 65 'io_dart': '<(gen_source_dir)/io_gen.dart', |
52 }, | 66 }, |
53 'sources': [ | 67 'sources': [ |
54 'io.dart', | 68 'io.dart', |
55 ], | 69 ], |
56 'includes': [ | 70 'includes': [ |
57 '../../sdk/lib/io/iolib_sources.gypi', | 71 '../../sdk/lib/io/iolib_sources.gypi', |
58 ], | 72 ], |
59 'actions': [ | 73 'actions': [ |
60 { | 74 { |
61 'action_name': 'generate_io_dart', | 75 'action_name': 'generate_io_dart', |
(...skipping 30 matching lines...) Expand all Loading... |
92 '--var_name', 'Builtin::io_source_', | 106 '--var_name', 'Builtin::io_source_', |
93 '<(io_dart)', | 107 '<(io_dart)', |
94 ], | 108 ], |
95 'message': 'Generating ''<(io_cc_file)'' file.' | 109 'message': 'Generating ''<(io_cc_file)'' file.' |
96 }, | 110 }, |
97 ] | 111 ] |
98 }, | 112 }, |
99 { | 113 { |
100 'target_name': 'generate_io_patch_cc_file', | 114 'target_name': 'generate_io_patch_cc_file', |
101 'type': 'none', | 115 'type': 'none', |
| 116 'toolsets':['target','host'], |
102 'includes': [ | 117 'includes': [ |
103 'io_sources.gypi', | 118 'io_sources.gypi', |
104 ], | 119 ], |
105 'actions': [ | 120 'actions': [ |
106 { | 121 { |
107 'action_name': 'generate_io_patch_cc', | 122 'action_name': 'generate_io_patch_cc', |
108 'inputs': [ | 123 'inputs': [ |
109 '../tools/create_string_literal.py', | 124 '../tools/create_string_literal.py', |
110 '<(builtin_in_cc_file)', | 125 '<(builtin_in_cc_file)', |
111 '<@(_sources)', | 126 '<@(_sources)', |
(...skipping 10 matching lines...) Expand all Loading... |
122 '--var_name', 'Builtin::io_patch_', | 137 '--var_name', 'Builtin::io_patch_', |
123 '<@(_sources)', | 138 '<@(_sources)', |
124 ], | 139 ], |
125 'message': 'Generating ''<(io_patch_cc_file)'' file.' | 140 'message': 'Generating ''<(io_patch_cc_file)'' file.' |
126 }, | 141 }, |
127 ] | 142 ] |
128 }, | 143 }, |
129 { | 144 { |
130 'target_name': 'libdart_builtin', | 145 'target_name': 'libdart_builtin', |
131 'type': 'static_library', | 146 'type': 'static_library', |
| 147 'toolsets':['target','host'], |
132 'dependencies': [ | 148 'dependencies': [ |
133 'generate_builtin_cc_file', | 149 'generate_builtin_cc_file', |
134 'generate_io_cc_file', | 150 'generate_io_cc_file', |
135 'generate_io_patch_cc_file', | 151 'generate_io_patch_cc_file', |
136 ], | 152 ], |
137 'include_dirs': [ | 153 'include_dirs': [ |
138 '..', | 154 '..', |
139 ], | 155 ], |
140 'sources': [ | 156 'sources': [ |
141 'builtin_natives.cc', | 157 'builtin_natives.cc', |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 'CharacterSet': '0', | 227 'CharacterSet': '0', |
212 }, | 228 }, |
213 }, | 229 }, |
214 }, | 230 }, |
215 }], | 231 }], |
216 ], | 232 ], |
217 }, | 233 }, |
218 { | 234 { |
219 'target_name': 'libdart_withcore', | 235 'target_name': 'libdart_withcore', |
220 'type': 'static_library', | 236 'type': 'static_library', |
| 237 'toolsets':['target','host'], |
221 'dependencies': [ | 238 'dependencies': [ |
222 'libdart_lib_withcore', | 239 'libdart_lib_withcore', |
223 'libdart_vm', | 240 'libdart_vm', |
224 'libjscre', | 241 'libjscre', |
225 'libdouble_conversion', | 242 'libdouble_conversion', |
226 'generate_version_cc_file', | 243 'generate_version_cc_file', |
227 ], | 244 ], |
228 'include_dirs': [ | 245 'include_dirs': [ |
229 '..', | 246 '..', |
230 ], | 247 ], |
231 'sources': [ | 248 'sources': [ |
232 '../include/dart_api.h', | 249 '../include/dart_api.h', |
233 '../include/dart_debugger_api.h', | 250 '../include/dart_debugger_api.h', |
234 '../vm/dart_api_impl.cc', | 251 '../vm/dart_api_impl.cc', |
235 '../vm/debugger_api_impl.cc', | 252 '../vm/debugger_api_impl.cc', |
236 '<(version_cc_file)', | 253 '<(version_cc_file)', |
237 ], | 254 ], |
238 'defines': [ | 255 'defines': [ |
239 'DART_SHARED_LIB', | 256 'DART_SHARED_LIB', |
240 ], | 257 ], |
241 }, | 258 }, |
242 { | 259 { |
243 # Completely statically linked binary for generating snapshots. | 260 # Completely statically linked binary for generating snapshots. |
244 'target_name': 'gen_snapshot', | 261 'target_name': 'gen_snapshot', |
245 'type': 'executable', | 262 'type': 'executable', |
| 263 'toolsets':['host'], |
246 'dependencies': [ | 264 'dependencies': [ |
247 'libdart_withcore', | 265 'libdart_withcore', |
248 'libdart_builtin', | 266 'libdart_builtin', |
249 ], | 267 ], |
250 'include_dirs': [ | 268 'include_dirs': [ |
251 '..', | 269 '..', |
252 ], | 270 ], |
253 'sources': [ | 271 'sources': [ |
254 'gen_snapshot.cc', | 272 'gen_snapshot.cc', |
255 # Only looks up native functions in libdart_builtin, not libdart_io. | 273 # Only looks up native functions in libdart_builtin, not libdart_io. |
(...skipping 13 matching lines...) Expand all Loading... |
269 'link_settings': { | 287 'link_settings': { |
270 'libraries': [ '-llog' ], | 288 'libraries': [ '-llog' ], |
271 }, | 289 }, |
272 }] | 290 }] |
273 ], | 291 ], |
274 }, | 292 }, |
275 { | 293 { |
276 # Generate snapshot bin file. | 294 # Generate snapshot bin file. |
277 'target_name': 'generate_snapshot_bin', | 295 'target_name': 'generate_snapshot_bin', |
278 'type': 'none', | 296 'type': 'none', |
| 297 'toolsets':['host'], |
279 'dependencies': [ | 298 'dependencies': [ |
280 'gen_snapshot', | 299 'gen_snapshot#host', |
281 ], | 300 ], |
282 'actions': [ | 301 'actions': [ |
283 { | 302 { |
284 'action_name': 'generate_snapshot_bin', | 303 'action_name': 'generate_snapshot_bin', |
285 'inputs': [ | 304 'inputs': [ |
286 '../tools/create_snapshot_bin.py', | 305 '../tools/create_snapshot_bin.py', |
287 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen_snapshot<(EXECUTABLE_SUFFIX)
', | 306 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen_snapshot<(EXECUTABLE_SUFFIX)
', |
288 ], | 307 ], |
289 'outputs': [ | 308 'outputs': [ |
290 '<(snapshot_bin_file)', | 309 '<(snapshot_bin_file)', |
291 ], | 310 ], |
292 'action': [ | 311 'action': [ |
293 'python', | 312 'python', |
294 'tools/create_snapshot_bin.py', | 313 'tools/create_snapshot_bin.py', |
295 '--executable', | 314 '--executable', |
296 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen_snapshot<(EXECUTABLE_SUFFIX)
', | 315 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen_snapshot<(EXECUTABLE_SUFFIX)
', |
297 '--output_bin', '<(snapshot_bin_file)', | 316 '--output_bin', '<(snapshot_bin_file)', |
298 '--target_os', '<(OS)' | 317 '--target_os', '<(OS)' |
299 ], | 318 ], |
300 'message': 'Generating ''<(snapshot_bin_file)'' file.' | 319 'message': 'Generating ''<(snapshot_bin_file)'' file.' |
301 }, | 320 }, |
302 ], | 321 ], |
303 }, | 322 }, |
304 { | 323 { |
305 # Generate snapshot file. | 324 # Generate snapshot file. |
306 'target_name': 'generate_snapshot_file', | 325 'target_name': 'generate_snapshot_file', |
307 'type': 'none', | 326 'type': 'none', |
| 327 'toolsets':['host'], |
308 'dependencies': [ | 328 'dependencies': [ |
309 'generate_snapshot_bin', | 329 'generate_snapshot_bin#host', |
310 ], | 330 ], |
311 'actions': [ | 331 'actions': [ |
312 { | 332 { |
313 'action_name': 'generate_snapshot_file', | 333 'action_name': 'generate_snapshot_file', |
314 'inputs': [ | 334 'inputs': [ |
315 '../tools/create_snapshot_file.py', | 335 '../tools/create_snapshot_file.py', |
316 '<(snapshot_in_cc_file)', | 336 '<(snapshot_in_cc_file)', |
317 '<(snapshot_bin_file)' | 337 '<(snapshot_bin_file)' |
318 ], | 338 ], |
319 'outputs': [ | 339 'outputs': [ |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 ] | 378 ] |
359 }, | 379 }, |
360 { | 380 { |
361 # dart binary with a snapshot of corelibs built in. | 381 # dart binary with a snapshot of corelibs built in. |
362 'target_name': 'dart', | 382 'target_name': 'dart', |
363 'type': 'executable', | 383 'type': 'executable', |
364 'dependencies': [ | 384 'dependencies': [ |
365 'libdart', | 385 'libdart', |
366 'libdart_builtin', | 386 'libdart_builtin', |
367 'libdart_io', | 387 'libdart_io', |
368 'generate_snapshot_file', | 388 'generate_snapshot_file#host', |
369 'generate_resources_cc_file', | 389 'generate_resources_cc_file', |
370 ], | 390 ], |
371 'include_dirs': [ | 391 'include_dirs': [ |
372 '..', | 392 '..', |
373 ], | 393 ], |
374 'sources': [ | 394 'sources': [ |
375 'main.cc', | 395 'main.cc', |
376 'builtin_nolib.cc', | 396 'builtin_nolib.cc', |
377 'resources.h', | 397 'resources.h', |
378 'vmstats.h', | 398 'vmstats.h', |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 'target_name': 'run_vm_tests', | 491 'target_name': 'run_vm_tests', |
472 'type': 'executable', | 492 'type': 'executable', |
473 'dependencies': [ | 493 'dependencies': [ |
474 'libdart_withcore', | 494 'libdart_withcore', |
475 'libdart_builtin', | 495 'libdart_builtin', |
476 'libdart_io', | 496 'libdart_io', |
477 'generate_snapshot_test_dat_file', | 497 'generate_snapshot_test_dat_file', |
478 ], | 498 ], |
479 'include_dirs': [ | 499 'include_dirs': [ |
480 '..', | 500 '..', |
481 '<(SHARED_INTERMEDIATE_DIR)', | 501 '<(gen_source_dir)', |
482 ], | 502 ], |
483 'sources': [ | 503 'sources': [ |
484 'run_vm_tests.cc', | 504 'run_vm_tests.cc', |
485 'builtin.cc', | 505 'builtin.cc', |
486 # Include generated source files. | 506 # Include generated source files. |
487 '<(builtin_cc_file)', | 507 '<(builtin_cc_file)', |
488 '<(io_cc_file)', | 508 '<(io_cc_file)', |
489 '<(io_patch_cc_file)', | 509 '<(io_patch_cc_file)', |
490 ], | 510 ], |
491 'includes': [ | 511 'includes': [ |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 ['OS=="linux"', { | 566 ['OS=="linux"', { |
547 'cflags': [ | 567 'cflags': [ |
548 '-fPIC', | 568 '-fPIC', |
549 ], | 569 ], |
550 }], | 570 }], |
551 ], | 571 ], |
552 }, | 572 }, |
553 ], | 573 ], |
554 } | 574 } |
555 | 575 |
OLD | NEW |