Skip to content

Commit 9c45758

Browse files
kenanyitaloacasas
authored andcommitted
build: fix building with ninja on linux
On Linux, `ninja` appears to place `libv8_base.a` inside `OBJ_DIR`, as opposed to `ninja` on OS X which places it outside of that directory. Furthermore, the expected `OBJ_DIR` value (`obj.target/`) is actually just `obj/` for `ninja`. This patch solves both of these issues by setting `OBJ_DIR` and `V8_BASE` to the correct values for `ninja` on Linux specifically. PR-URL: #11348 Fixes: #9861 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent d8cb65a commit 9c45758

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

common.gypi

+10-3
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,19 @@
4242
'os_posix': 1,
4343
'v8_postmortem_support%': 'true',
4444
}],
45-
['GENERATOR == "ninja" or OS== "mac"', {
45+
['OS== "mac"', {
4646
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
4747
'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
4848
}, {
49-
'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
50-
'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
49+
'conditions': [
50+
['GENERATOR=="ninja"', {
51+
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
52+
'V8_BASE': '<(PRODUCT_DIR)/obj/deps/v8/src/libv8_base.a',
53+
}, {
54+
'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
55+
'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
56+
}],
57+
],
5158
}],
5259
['openssl_fips != ""', {
5360
'OPENSSL_PRODUCT': 'libcrypto.a',

node.gyp

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@
383383
['OS in "linux freebsd" and node_shared=="false"', {
384384
'ldflags': [
385385
'-Wl,--whole-archive,'
386-
'<(PRODUCT_DIR)/obj.target/deps/openssl/'
386+
'<(OBJ_DIR)/deps/openssl/'
387387
'<(OPENSSL_PRODUCT)',
388388
'-Wl,--no-whole-archive',
389389
],

0 commit comments

Comments
 (0)