| 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 | deps=[
|
| 52 | '//asdl/hnode.asdl',
|
| 53 | '//cpp/data_lang', # for fastfunc
|
| 54 | ])
|
| 55 |
|
| 56 | ru.cc_library(
|
| 57 | '//prebuilt/core/error.mycpp',
|
| 58 | srcs=['prebuilt/core/error.mycpp.cc'],
|
| 59 | deps=[
|
| 60 | '//asdl/hnode.asdl',
|
| 61 | '//core/value.asdl',
|
| 62 | '//frontend/syntax.asdl',
|
| 63 | '//cpp/data_lang', # for fastfunc
|
| 64 | ])
|
| 65 |
|
| 66 | ru.cc_library(
|
| 67 | '//prebuilt/frontend/args.mycpp',
|
| 68 | srcs=['prebuilt/frontend/args.mycpp.cc'],
|
| 69 | deps=[
|
| 70 | '//asdl/hnode.asdl',
|
| 71 | '//core/runtime.asdl',
|
| 72 | '//frontend/syntax.asdl',
|
| 73 | '//cpp/data_lang', # for fastfunc
|
| 74 | '//cpp/frontend_flag_spec',
|
| 75 | ])
|