| 1 | """
 | 
| 2 | data_lang/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 | 
 | 
| 11 | def NinjaGraph(ru):
 | 
| 12 |     n = ru.n
 | 
| 13 | 
 | 
| 14 |     ru.comment('Generated by %s' % __name__)
 | 
| 15 | 
 | 
| 16 |     ru.asdl_library('data_lang/nil8.asdl')
 | 
| 17 |     ru.asdl_library('data_lang/pretty.asdl')
 | 
| 18 | 
 | 
| 19 |     ru.cc_binary(
 | 
| 20 |         'data_lang/utf8_test.cc',
 | 
| 21 |         deps=['//data_lang/utf8'],
 | 
| 22 |         # Add tcmalloc for malloc_address_test
 | 
| 23 |         matrix=ninja_lib.COMPILERS_VARIANTS + [('cxx', 'tcmalloc')])
 | 
| 24 | 
 | 
| 25 |     ru.cc_library(
 | 
| 26 |         '//data_lang/j8_test_lib',
 | 
| 27 |         srcs=['data_lang/j8_test_lib.c'],
 | 
| 28 |         deps=[],
 | 
| 29 |     )
 | 
| 30 | 
 | 
| 31 |     # A header-only library in C, that can be used from C or C++
 | 
| 32 |     ru.cc_library(
 | 
| 33 |         '//data_lang/j8',
 | 
| 34 |         srcs=[],
 | 
| 35 |         headers=['data_lang/j8.h'],
 | 
| 36 |         deps=['//data_lang/utf8'],
 | 
| 37 |     )
 | 
| 38 |     ru.cc_library(
 | 
| 39 |         '//data_lang/utf8',
 | 
| 40 |         srcs=[],
 | 
| 41 |         headers=['data_lang/utf8.h'],
 | 
| 42 |         deps=[],
 | 
| 43 |     )
 | 
| 44 | 
 | 
| 45 |     ru.cc_binary(
 | 
| 46 |         'data_lang/j8_test.cc',
 | 
| 47 |         deps=['//data_lang/j8', '//data_lang/j8_test_lib'],
 | 
| 48 |         # Add tcmalloc for malloc_address_test
 | 
| 49 |         matrix=ninja_lib.COMPILERS_VARIANTS + [('cxx', 'tcmalloc')])
 | 
| 50 | 
 | 
| 51 |     # A higher level C library that uses realloc().  Not meant for C++, which
 | 
| 52 |     # should use a zero-copy minimal malloc style.
 | 
| 53 | 
 | 
| 54 |     # TODO: restrict compiler flags to C99
 | 
| 55 |     # can't be used by C++ (otherwise we'd need a different _build/obj location)
 | 
| 56 |     ru.cc_library(
 | 
| 57 |         '//data_lang/j8_libc',
 | 
| 58 |         srcs=['data_lang/j8_libc.c'],
 | 
| 59 |         deps=['//data_lang/j8'],
 | 
| 60 |     )
 | 
| 61 | 
 | 
| 62 |     # TODO: restrict compiler flags to C99
 | 
| 63 |     ru.cc_binary(
 | 
| 64 |         'data_lang/j8_libc_test.c',
 | 
| 65 |         deps=['//data_lang/j8_libc', '//data_lang/j8_test_lib'],
 | 
| 66 |         # Add tcmalloc for malloc_address_test
 | 
| 67 |         matrix=ninja_lib.COMPILERS_VARIANTS + [('cxx', 'tcmalloc')])
 |