|
8 | 8 | # gyp does not appear to let you test for undefined variables, so define |
9 | 9 | # lldb_lib_dir as empty so we can test it later. |
10 | 10 | "lldb_lib_dir%": "", |
11 | | - "lldb_lib_so%": "" |
| 11 | + "lldb_lib_so%": "", |
| 12 | + "build_addon": "false", |
12 | 13 | }, |
13 | 14 |
|
14 | 15 | "target_defaults": { |
|
85 | 86 | ], |
86 | 87 | }] |
87 | 88 | ] |
88 | | - }, { |
89 | | - "target_name": "addon", |
90 | | - "type": "loadable_module", |
91 | | - "include_dirs": [ |
92 | | - "<!@(node -p \"require('node-addon-api').include\")" |
93 | | - ], |
94 | | - "defines": [ "NAPI_DISABLE_CPP_EXCEPTIONS" ], |
95 | | - "sources": [ |
96 | | - "src/addon.cc", |
97 | | - "src/llnode_module.cc", |
98 | | - "src/llnode_api.cc", |
99 | | - "src/constants.cc", |
100 | | - "src/error.cc", |
101 | | - "src/llv8.cc", |
102 | | - "src/llv8-constants.cc", |
103 | | - "src/llscan.cc", |
104 | | - "src/node-constants.cc", |
105 | | - ], |
106 | | - "cflags!": [ "-fno-exceptions" ], |
107 | | - "cflags_cc!": [ "-fno-exceptions" ], |
108 | | - "conditions": [ |
109 | | - [ "OS=='linux' or OS=='freebsd'", { |
| 89 | + }], |
| 90 | + |
| 91 | + "conditions": [ |
| 92 | + [ "build_addon == 'true'", { |
| 93 | + "targets": [{ |
| 94 | + "target_name": "addon", |
| 95 | + "type": "loadable_module", |
| 96 | + "include_dirs": [ |
| 97 | + "<!@(node -p \"require('node-addon-api').include\")" |
| 98 | + ], |
| 99 | + "defines": [ "NAPI_DISABLE_CPP_EXCEPTIONS" ], |
| 100 | + "sources": [ |
| 101 | + "src/addon.cc", |
| 102 | + "src/llnode_module.cc", |
| 103 | + "src/llnode_api.cc", |
| 104 | + "src/constants.cc", |
| 105 | + "src/error.cc", |
| 106 | + "src/llv8.cc", |
| 107 | + "src/llv8-constants.cc", |
| 108 | + "src/llscan.cc", |
| 109 | + "src/node-constants.cc", |
| 110 | + ], |
| 111 | + "cflags!": [ "-fno-exceptions" ], |
| 112 | + "cflags_cc!": [ "-fno-exceptions" ], |
110 | 113 | "conditions": [ |
111 | | - # If we could not locate the lib dir, then we will have to search |
112 | | - # from the global search paths during linking and at runtime |
113 | | - [ "lldb_lib_dir != ''", { |
114 | | - "ldflags": [ |
115 | | - "-L<(lldb_lib_dir)", |
116 | | - "-Wl,-rpath,<(lldb_lib_dir)" |
| 114 | + [ "OS=='linux' or OS=='freebsd'", { |
| 115 | + "conditions": [ |
| 116 | + # If we could not locate the lib dir, then we will have to search |
| 117 | + # from the global search paths during linking and at runtime |
| 118 | + [ "lldb_lib_dir != ''", { |
| 119 | + "ldflags": [ |
| 120 | + "-L<(lldb_lib_dir)", |
| 121 | + "-Wl,-rpath,<(lldb_lib_dir)" |
| 122 | + ] |
| 123 | + }], |
| 124 | + # If we cannot find a non-versioned library liblldb(-x.y).so, |
| 125 | + # then we will have to link to the versioned library |
| 126 | + # liblldb(-x.y).so.z loaded by the detected lldb executable |
| 127 | + [ "lldb_lib_so != ''", { |
| 128 | + "libraries": ["<(lldb_lib_so)"] |
| 129 | + }, { |
| 130 | + "libraries": ["-l<(lldb_lib)"] |
| 131 | + }] |
117 | 132 | ] |
118 | | - }], |
119 | | - # If we cannot find a non-versioned library liblldb(-x.y).so, |
120 | | - # then we will have to link to the versioned library |
121 | | - # liblldb(-x.y).so.z loaded by the detected lldb executable |
122 | | - [ "lldb_lib_so != ''", { |
123 | | - "libraries": ["<(lldb_lib_so)"] |
124 | | - }, { |
125 | | - "libraries": ["-l<(lldb_lib)"] |
126 | 133 | }] |
127 | 134 | ] |
128 | 135 | }] |
129 | | - ] |
130 | | - }] |
| 136 | + }] |
| 137 | + ] |
131 | 138 | } |
0 commit comments