forked from TryGhost/node-sqlite3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbinding.gyp
More file actions
97 lines (97 loc) · 2.84 KB
/
binding.gyp
File metadata and controls
97 lines (97 loc) · 2.84 KB
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
{
"includes": [ "deps/common-sqlite.gypi" ],
"variables": {
"sqlite%":"internal",
"sqlite_libname%":"sqlite3",
"module_name": "node_sqlite3",
},
"targets": [
{
"target_name": "<(module_name)",
"xcode_settings": {
"CLANG_CXX_LIBRARY": "libc++",
"MACOSX_DEPLOYMENT_TARGET": "10.7",
"OTHER_CFLAGS": [ "-fstack-protector-strong" ]
},
"include_dirs": [
"<!@(node -p \"require('node-addon-api').include\")"],
"conditions": [
["sqlite != 'internal'", {
"include_dirs": [
"<!@(node -p \"require('node-addon-api').include\")", "<(sqlite)/include" ],
"libraries": [
"-l<(sqlite_libname)"
],
"conditions": [
[ "OS=='linux'", {"libraries+":["-Wl,-rpath=<@(sqlite)/lib"]} ],
[ "OS!='win'", {"libraries+":["-L<@(sqlite)/lib"]} ]
],
'msvs_settings': {
'VCLinkerTool': {
'AdditionalLibraryDirectories': [
'<(sqlite)/lib'
],
},
}
},
{
"dependencies": [
"<!(node -p \"require('node-addon-api').targets\"):node_addon_api_except",
"deps/sqlite3.gyp:sqlite3"
]
}
],
# Linux hardening flags (apply to all builds)
["OS=='linux'", {
"cflags+": [
"-fstack-protector-strong",
"-fPIC"
],
"ldflags+": [ "-Wl,-z,relro,-z,now" ]
}],
# Windows hardening flags (apply to all builds)
["OS=='win'", {
"msvs_settings": {
"VCCLCompilerTool": {
"ExceptionHandling": 1,
"BufferSecurityCheck": "true",
"ControlFlowGuard": "Guard"
},
"VCLinkerTool": {
"AdditionalOptions": [ "/DYNAMICBASE", "/NXCOMPAT" ]
}
}
}]
],
"sources": [
"src/backup.cc",
"src/database.cc",
"src/node_sqlite3.cc",
"src/statement.cc"
],
"defines": [ "NAPI_VERSION=<(napi_build_version)" ],
# Release-specific hardening flags
"configurations": {
"Release": {
"conditions": [
# _FORTIFY_SOURCE applies to all Linux architectures
["OS=='linux'", {
"defines+": [ "_FORTIFY_SOURCE=2" ]
}],
# Control Flow Protection only for x86_64 (Intel CET)
["OS=='linux' and target_arch=='x64'", {
"cflags+": [ "-fcf-protection=full" ]
}],
["OS=='win'", {
"msvs_settings": {
"VCCLCompilerTool": {
"AdditionalOptions": [ "/sdl" ]
}
}
}]
]
}
}
}
]
}