1 | """
|
2 | core/NINJA_subgraph.py
|
3 | """
|
4 |
|
5 | from __future__ import print_function
|
6 |
|
7 | from build import ninja_lib
|
8 | from build.ninja_lib import log
|
9 |
|
10 | _ = log
|
11 |
|
12 |
|
13 | def NinjaGraph(ru):
|
14 | n = ru.n
|
15 |
|
16 | ru.comment('Generated by %s' % __name__)
|
17 |
|
18 | ru.py_binary('core/optview_gen.py')
|
19 |
|
20 | n.rule(
|
21 | 'optview-gen',
|
22 | # uses shell style
|
23 | command='_bin/shwrap/optview_gen > $out',
|
24 | description='optview_gen > $out')
|
25 |
|
26 | n.build(['_gen/core/optview.h'],
|
27 | 'optview-gen', [],
|
28 | implicit=['_bin/shwrap/optview_gen'])
|
29 | n.newline()
|
30 |
|
31 | ru.cc_library('//core/optview',
|
32 | srcs=[],
|
33 | generated_headers=['_gen/core/optview.h'],
|
34 | deps=['//frontend/option.asdl'])
|
35 |
|
36 | ru.cc_binary('core/optview_test.cc',
|
37 | deps=['//core/optview'],
|
38 | matrix=ninja_lib.SMALL_TEST_MATRIX)
|
39 |
|
40 | ru.asdl_library(
|
41 | 'core/runtime.asdl',
|
42 | deps=[
|
43 | # #include in header file
|
44 | # Problem: asdl_main.py hard-codes this dependency
|
45 | '//frontend/id_kind.asdl',
|
46 | # #include in cc file from 'use' deps
|
47 | '//frontend/syntax.asdl',
|
48 | '//core/value.asdl'
|
49 | ])
|
50 |
|
51 | ru.asdl_library(
|
52 | 'core/value.asdl',
|
53 | # #include in cc file from 'use' deps
|
54 | deps=['//frontend/syntax.asdl', '//core/runtime.asdl'])
|
55 |
|
56 | ru.cc_binary('core/runtime_asdl_test.cc',
|
57 | deps=['//core/runtime.asdl'],
|
58 | matrix=ninja_lib.SMALL_TEST_MATRIX)
|