| 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 |
|
| 18 | ru.cc_binary(
|
| 19 | 'data_lang/utf8_test.cc',
|
| 20 | deps=['//data_lang/utf8'],
|
| 21 | # Add tcmalloc for malloc_address_test
|
| 22 | matrix=ninja_lib.COMPILERS_VARIANTS + [('cxx', 'tcmalloc')])
|
| 23 |
|
| 24 | ru.cc_library(
|
| 25 | '//data_lang/j8_test_lib',
|
| 26 | srcs=['data_lang/j8_test_lib.c'],
|
| 27 | deps=[],
|
| 28 | )
|
| 29 |
|
| 30 | # A header-only library in C, that can be used from C or C++
|
| 31 | ru.cc_library(
|
| 32 | '//data_lang/j8',
|
| 33 | srcs=[],
|
| 34 | headers=['data_lang/j8.h'],
|
| 35 | deps=['//data_lang/utf8'],
|
| 36 | )
|
| 37 | ru.cc_library(
|
| 38 | '//data_lang/utf8',
|
| 39 | srcs=[],
|
| 40 | headers=['data_lang/utf8.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')])
|