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