1 | """
|
2 | prebuilt/NINJA_subgraph.py
|
3 | """
|
4 |
|
5 | from __future__ import print_function
|
6 |
|
7 | from build.ninja_lib import log
|
8 |
|
9 | _ = log
|
10 |
|
11 |
|
12 | def NinjaGraph(ru):
|
13 |
|
14 | ru.comment('Generated by %s' % __name__)
|
15 |
|
16 | # These files are checked in. See prebuilt/translate.sh includes
|
17 |
|
18 | # TODO: Because of J8 notation, prebuilt/translate.sh will
|
19 | # include
|
20 | #
|
21 | # data_lang/j8_lite.py
|
22 | #
|
23 | # And then it calls:
|
24 | #
|
25 | # fastfunc.J8EncodeString()
|
26 | # match.CanOmitQuotes() or fastlex.CanOmitQuotes()
|
27 | #
|
28 | # So that means that we need may want a cc_library()
|
29 | # data_lang/j8_lite_deps
|
30 | #
|
31 | # That includes both
|
32 | #
|
33 | # //data_lang/j8 # header only C library
|
34 | # //pyext/fastfunc
|
35 | # //cpp/frontend_match or //pyext/fastlex
|
36 | #
|
37 | # So prebuilt/ and oils-for-unix depend on //data_lang/j8_lite
|
38 | # That makes sense
|
39 | #
|
40 | # or maybe it's pyext/j8_lite_deps.{h,cc}
|
41 | # That kind makes sense
|
42 | #
|
43 | # And is it OK for the main binary to depend on that?
|
44 | # The problem is that you will pull in TWO COPIES of the huge match.asdl.h
|
45 | # header
|
46 | # This can bloat the binary size. But it will be mostly unused.
|
47 |
|
48 | ru.cc_library(
|
49 | '//prebuilt/asdl/runtime.mycpp',
|
50 | srcs=['prebuilt/asdl/runtime.mycpp.cc'],
|
51 | # TODO: make a common library for these deps?
|
52 | deps=[
|
53 | '//asdl/hnode.asdl',
|
54 | '//cpp/data_lang', # for fastfunc
|
55 | '//display/pretty.asdl',
|
56 | ])
|
57 |
|
58 | ru.cc_library(
|
59 | '//prebuilt/core/error.mycpp',
|
60 | srcs=['prebuilt/core/error.mycpp.cc'],
|
61 | deps=[
|
62 | '//asdl/hnode.asdl',
|
63 | '//core/value.asdl',
|
64 | '//frontend/syntax.asdl',
|
65 | '//cpp/data_lang', # for fastfunc
|
66 | '//display/pretty.asdl',
|
67 | ])
|
68 |
|
69 | ru.cc_library(
|
70 | '//prebuilt/frontend/args.mycpp',
|
71 | srcs=['prebuilt/frontend/args.mycpp.cc'],
|
72 | deps=[
|
73 | '//asdl/hnode.asdl',
|
74 | '//core/runtime.asdl',
|
75 | '//frontend/syntax.asdl',
|
76 | '//cpp/data_lang', # for fastfunc
|
77 | '//cpp/frontend_flag_spec',
|
78 | '//display/pretty.asdl',
|
79 | ])
|