Skip to content

Commit 2d48b89

Browse files
authored
Merge pull request #251 from Seventysevendays/feature/win-binding
2 parents 9bd2179 + a819842 commit 2d48b89

File tree

1 file changed

+27
-15
lines changed

1 file changed

+27
-15
lines changed

binding.gyp

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,21 @@
44
"target_name": "nodejieba",
55
"cflags!": [ "-fno-exceptions" ],
66
"cflags_cc!": [ "-fno-exceptions" ],
7-
"xcode_settings": { "GCC_ENABLE_CPP_EXCEPTIONS": "YES",
7+
"xcode_settings": {
8+
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
89
"CLANG_CXX_LIBRARY": "libc++",
910
"MACOSX_DEPLOYMENT_TARGET": "10.13",
1011
},
1112
"msvs_settings": {
12-
"VCCLCompilerTool": { "ExceptionHandling": 1 },
13+
"VCCLCompilerTool": {
14+
"ExceptionHandling": 1,
15+
"AdditionalOptions": ["/std:c++14","/utf-8"]
16+
},
1317
},
1418
"win_delay_load_hook": "true",
1519
"sources": [
16-
"./lib/index.cpp",
17-
"./lib/nodejieba.cpp",
20+
"./lib/index.cpp",
21+
"./lib/nodejieba.cpp",
1822
],
1923
"cflags": [
2024
"-DLOGGING_LEVEL=LL_WARNING"
@@ -34,18 +38,26 @@
3438
}
3539
}
3640
},
37-
"conditions": [
38-
[ "OS == 'mac'", {
39-
"xcode_settings": {
40-
"OTHER_CPLUSPLUSFLAGS":[
41-
"-mmacosx-version-min=10.13",
42-
"-std=c++14",
43-
"-stdlib=libc++",
41+
"conditions": [
42+
[ "OS == 'mac'", {
43+
"xcode_settings": {
44+
"OTHER_CPLUSPLUSFLAGS":[
45+
"-mmacosx-version-min=10.13",
46+
"-std=c++14",
47+
"-stdlib=libc++",
4448
"-DLOGGING_LEVEL=LL_WARNING",
45-
]
46-
}
47-
}],
48-
],
49+
]
50+
}
51+
}],
52+
# 添加Windows特定条件
53+
[ "OS == 'win'", {
54+
"msvs_settings": {
55+
"VCCLCompilerTool": {
56+
"AdditionalOptions": ["/std:c++14"]
57+
}
58+
}
59+
}]
60+
],
4961
}
5062
]
5163
}

0 commit comments

Comments
 (0)