forked from tree-sitter/tree-sitter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
project.gyp
163 lines (157 loc) · 4.78 KB
/
project.gyp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
{
'targets': [
{
'target_name': 'compiler',
'type': 'static_library',
'include_dirs': [
'include',
'src',
'externals/utf8proc',
],
'sources': [
'src/compiler/build_tables/build_lex_table.cc',
'src/compiler/build_tables/build_parse_table.cc',
'src/compiler/build_tables/build_tables.cc',
'src/compiler/build_tables/does_match_any_line.cc',
'src/compiler/build_tables/item_set_closure.cc',
'src/compiler/build_tables/lex_item.cc',
'src/compiler/build_tables/lex_item_transitions.cc',
'src/compiler/build_tables/lex_conflict_manager.cc',
'src/compiler/build_tables/lookahead_set.cc',
'src/compiler/build_tables/parse_item.cc',
'src/compiler/build_tables/parse_conflict_manager.cc',
'src/compiler/build_tables/rule_can_be_blank.cc',
'src/compiler/compile.cc',
'src/compiler/generate_code/c_code.cc',
'src/compiler/grammar.cc',
'src/compiler/lex_table.cc',
'src/compiler/parse_table.cc',
'src/compiler/precedence_range.cc',
'src/compiler/prepare_grammar/expand_repeats.cc',
'src/compiler/prepare_grammar/expand_tokens.cc',
'src/compiler/prepare_grammar/extract_choices.cc',
'src/compiler/prepare_grammar/extract_tokens.cc',
'src/compiler/prepare_grammar/flatten_grammar.cc',
'src/compiler/prepare_grammar/intern_symbols.cc',
'src/compiler/prepare_grammar/is_token.cc',
'src/compiler/prepare_grammar/normalize_rules.cc',
'src/compiler/prepare_grammar/parse_regex.cc',
'src/compiler/prepare_grammar/prepare_grammar.cc',
'src/compiler/prepare_grammar/token_description.cc',
'src/compiler/rule.cc',
'src/compiler/syntax_grammar.cc',
'src/compiler/variable.cc',
'src/compiler/rules/blank.cc',
'src/compiler/rules/built_in_symbols.cc',
'src/compiler/rules/character_range.cc',
'src/compiler/rules/character_set.cc',
'src/compiler/rules/choice.cc',
'src/compiler/rules/metadata.cc',
'src/compiler/rules/named_symbol.cc',
'src/compiler/rules/pattern.cc',
'src/compiler/rules/repeat.cc',
'src/compiler/rules/rules.cc',
'src/compiler/rules/seq.cc',
'src/compiler/rules/string.cc',
'src/compiler/rules/symbol.cc',
'src/compiler/rules/visitor.cc',
'src/compiler/util/string_helpers.cc',
'externals/utf8proc/utf8proc.c',
],
'cflags_cc': [
'-std=c++0x',
],
'cflags_cc!': [
'-fno-rtti'
],
'xcode_settings': {
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
'GCC_ENABLE_CPP_RTTI': 'YES',
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
},
'direct_dependent_settings': {
'include_dirs': [
'include'
],
},
# Mac OS has an old version of libstdc++ that doesn't support c++11.
# libc++ is only present on 10.7 and later.
'conditions': [
['OS == "mac"', {
'cflags_cc': [ '-stdlib=libc++' ],
'xcode_settings': {
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
},
'direct_dependent_settings': {
'cflags_cc': [ '-stdlib=libc++' ],
'xcode_settings': {
'CLANG_CXX_LIBRARY': 'libc++',
},
},
}]
],
},
{
'target_name': 'runtime',
'type': 'static_library',
'include_dirs': [
'include',
'src',
'externals/utf8proc',
],
'sources': [
'src/runtime/document.c',
'src/runtime/language.c',
'src/runtime/lexer.c',
'src/runtime/node.c',
'src/runtime/stack.c',
'src/runtime/parser.c',
'src/runtime/string_input.c',
'src/runtime/tree.c',
'externals/utf8proc/utf8proc.c',
],
'cflags_c': [
'-std=c99'
],
'ldflags': [
'-g',
],
'direct_dependent_settings': {
'include_dirs': [
'include'
],
},
},
],
'target_defaults': {
'default_configuration': 'Release',
'configurations': {
'Debug': {
'cflags': [ '-g' ],
'ldflags': [ '-g' ],
'xcode_settings': {
'OTHER_LDFLAGS': ['-g'],
'GCC_OPTIMIZATION_LEVEL': '0',
},
},
'Release': {
'cflags': [ '-O2', '-fno-strict-aliasing' ],
'cflags!': [ '-O3', '-fstrict-aliasing' ],
},
},
'cflags': [
'-Wall',
'-Wextra',
'-Wno-unused-parameter'
],
'xcode_settings': {
'ALWAYS_SEARCH_USER_PATHS': 'NO',
'WARNING_CFLAGS': [
'-Wall',
'-Wextra',
'-Wno-unused-parameter'
],
},
}
}