forked from atom/superstring
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbinding.gyp
167 lines (164 loc) · 5.75 KB
/
binding.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
164
165
166
167
{
"targets": [
{
"target_name": "superstring",
"dependencies": [
"superstring_core"
],
"sources": [
"src/bindings/bindings.cc",
"src/bindings/marker-index-wrapper.cc",
"src/bindings/patch-wrapper.cc",
"src/bindings/point-wrapper.cc",
"src/bindings/range-wrapper.cc",
"src/bindings/text-buffer-wrapper.cc",
"src/bindings/text-buffer-snapshot-wrapper.cc",
"src/bindings/text-reader.cc",
"src/bindings/string-conversion.cc",
"src/bindings/text-writer.cc",
],
"include_dirs": [
"src/core",
"<!(node -e \"require('nan')\")"
],
},
{
"target_name": "superstring_core",
"type": "static_library",
"dependencies": [
"./vendor/pcre/pcre.gyp:pcre",
],
"sources": [
"src/core/encoding-conversion.cc",
"src/core/marker-index.cc",
"src/core/patch.cc",
"src/core/point.cc",
"src/core/range.cc",
"src/core/regex.cc",
"src/core/text.cc",
"src/core/text-buffer.cc",
"src/core/text-slice.cc",
"src/core/text-diff.cc",
"src/core/libmba-diff.cc",
],
"include_dirs": [
"vendor/libcxx"
],
"conditions": [
['OS=="mac"', {
'link_settings': {
'libraries': ['libiconv.dylib'],
}
}],
['OS=="win"', {
'sources': [
'vendor/win-iconv/win_iconv.c',
],
'include_dirs': [
'vendor/win-iconv'
],
'defines': [
'WINICONV_CONST=',
'PCRE2_STATIC',
]
}],
],
}
],
"variables": {
"tests": 0,
"STANDARD": 17,
"MACOSX_DEPLOYMENT_TARGET": "10.15"
},
"conditions": [
# If --tests is passed to node-gyp configure, we'll build a standalone
# executable that runs tests on the patch.
['tests != 0', {
"targets": [{
"target_name": "tests",
"type": "executable",
"cflags_cc!": ["-fno-exceptions"],
"sources": [
"vendor/catch_amalgamated.cpp",
"test/native/test-helpers.cc",
"test/native/tests.cc",
"test/native/encoding-conversion-test.cc",
"test/native/patch-test.cc",
"test/native/text-buffer-test.cc",
"test/native/text-test.cc",
"test/native/text-diff-test.cc",
],
"include_dirs": [
"vendor",
"src/core",
],
"dependencies": [
"superstring_core"
],
"conditions": [
['OS=="mac"', {
'cflags': [
"-mmacosx-version-min=<(MACOSX_DEPLOYMENT_TARGET)"
],
"xcode_settings": {
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
'MACOSX_DEPLOYMENT_TARGET': '<(MACOSX_DEPLOYMENT_TARGET)',
}
}]
]
}]
}]
],
"target_defaults": {
"cflags_cc": [ "-std=c++<(STANDARD)" ],
"conditions": [
['OS=="mac"', {
"xcode_settings": {
'CLANG_CXX_LIBRARY': 'libc++',
'CLANG_CXX_LANGUAGE_STANDARD':'c++(STANDARD)',
}
}],
['OS=="win"', {
"link_settings": {
"libraries": ["ws2_32.lib"]
},
"defines": [
"NOMINMAX"
],
}]
],
'default_configuration': 'Release',
'configurations': {
# Release Settings
'Release': {
'defines': [ 'NDEBUG' ],
"cflags": [ "-fno-exceptions", "-O3" ],
"cflags_cc": [ "-fno-exceptions", "-O3", "-std=c++<(STANDARD)" ],
"xcode_settings": {
'GCC_OPTIMIZATION_LEVEL': '3', # stop gyp from defaulting to -Os
"CLANG_CXX_LIBRARY": "libc++",
"CLANG_CXX_LANGUAGE_STANDARD": "c++<(STANDARD)",
'MACOSX_DEPLOYMENT_TARGET': "<(MACOSX_DEPLOYMENT_TARGET)"
}, # XCODE
"msvs_settings": {
"VCCLCompilerTool": {
'ExceptionHandling': 0, # /EHsc
'MultiProcessorCompilation': 'true',
'RuntimeTypeInfo': 'false',
'Optimization': 3, # full optimizations /O2 == /Og /Oi /Ot /Oy /Ob2 /GF /Gy
'StringPooling': 'true', # pool string literals
"AdditionalOptions": [
# C++ standard
"/std:c++<(STANDARD)",
# Optimizations
"/O2",
# "/Ob3", # aggressive inline
"/GL", # whole Program Optimization # /LTCG is implied with /GL.
"/DNDEBUG" # turn off asserts
],
}
} # MSVC
}, # Release
}, # configurations
} # target-defaults
}