OILS / prebuilt / NINJA_subgraph.py View on Github | oilshell.org

76 lines, 32 significant
1"""
2prebuilt/NINJA_subgraph.py
3"""
4
5from __future__ import print_function
6
7from build import ninja_lib
8from build.ninja_lib import log
9
10_ = log
11
12
13def 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 ])