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

66 lines, 38 significant
1"""
2data_lang/NINJA_subgraph.py
3"""
4
5from __future__ import print_function
6
7from build import ninja_lib
8from build.ninja_lib import log
9
10
11def 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 # By Crockford
20 # https://github.com/douglascrockford/JSON-c/
21 ru.cc_library('//data_lang/utf8_impls/utf8_decode',
22 srcs=['data_lang/utf8_impls/utf8_decode.c'])
23
24 ru.cc_binary(
25 'data_lang/utf8_test.cc',
26 deps=['//data_lang/utf8_impls/utf8_decode'],
27 # Add tcmalloc for malloc_address_test
28 matrix=ninja_lib.COMPILERS_VARIANTS + [('cxx', 'tcmalloc')])
29
30 ru.cc_library(
31 '//data_lang/j8_test_lib',
32 srcs=['data_lang/j8_test_lib.c'],
33 deps=[],
34 )
35
36 # A header-only library in C, that can be used from C or C++
37 ru.cc_library(
38 '//data_lang/j8',
39 srcs=[],
40 headers=['data_lang/j8.h'],
41 deps=[],
42 )
43
44 ru.cc_binary(
45 'data_lang/j8_test.cc',
46 deps=['//data_lang/j8', '//data_lang/j8_test_lib'],
47 # Add tcmalloc for malloc_address_test
48 matrix=ninja_lib.COMPILERS_VARIANTS + [('cxx', 'tcmalloc')])
49
50 # A higher level C library that uses realloc(). Not meant for C++, which
51 # should use a zero-copy minimal malloc style.
52
53 # TODO: restrict compiler flags to C99
54 # can't be used by C++ (otherwise we'd need a different _build/obj location)
55 ru.cc_library(
56 '//data_lang/j8_libc',
57 srcs=['data_lang/j8_libc.c'],
58 deps=['//data_lang/j8'],
59 )
60
61 # TODO: restrict compiler flags to C99
62 ru.cc_binary(
63 'data_lang/j8_libc_test.c',
64 deps=['//data_lang/j8_libc', '//data_lang/j8_test_lib'],
65 # Add tcmalloc for malloc_address_test
66 matrix=ninja_lib.COMPILERS_VARIANTS + [('cxx', 'tcmalloc')])