forked from electron/electron
/
fix_add_default_values_for_variables_in_common_gypi.patch
36 lines (32 loc) · 1.46 KB
/
fix_add_default_values_for_variables_in_common_gypi.patch
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
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Wed, 19 Sep 2018 12:20:44 -0700
Subject: fix: add default values for variables in common.gypi
common.gypi is a file that's included in the node header bundle, despite
the fact that we do not build node with gyp.
diff --git a/common.gypi b/common.gypi
index 5372c8d42de531b68b97a7e8405724676ea7d5cf..2c2f3218a8ae387802af3d154ede601aedcb52dd 100644
--- a/common.gypi
+++ b/common.gypi
@@ -80,6 +80,23 @@
##### end V8 defaults #####
+ # When building native modules using 'npm install' with the system npm,
+ # node-gyp uses the `process.config` of the system npm to fill config.gypi.
+ # If the system npm is not as recent as Electron's node headers, which is
+ # likely, these variables will be missing from that config.gypi, and as a
+ # result, node-gyp will fail when building the native module with an error
+ # like:
+ #
+ # gyp: name 'enable_lto' is not defined while evaluating condition
+ # 'enable_lto=="true"' in binding.gyp while trying to load binding.gyp
+ #
+ # We set default values here to avoid that error message, even though these
+ # aren't technically accurate, because most native modules don't depend on
+ # these values being accurate.
+ 'build_v8_with_gn': 'false',
+ 'enable_lto%': 'false',
+ 'llvm_version': '0.0',
+
'conditions': [
['OS == "win"', {
'os_posix': 0,