Skip to content

Commit

Permalink
build: fix building with ninja on linux
Browse files Browse the repository at this point in the history
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 <info@bnoordhuis.nl>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
kenany authored and italoacasas committed Feb 22, 2017
1 parent d8cb65a commit 9c45758
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,19 @@
'os_posix': 1,
'v8_postmortem_support%': 'true',
}],
['GENERATOR == "ninja" or OS== "mac"', {
['OS== "mac"', {
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
}, {
'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
'conditions': [
['GENERATOR=="ninja"', {
'OBJ_DIR': '<(PRODUCT_DIR)/obj',
'V8_BASE': '<(PRODUCT_DIR)/obj/deps/v8/src/libv8_base.a',
}, {
'OBJ_DIR': '<(PRODUCT_DIR)/obj.target',
'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
}],
],
}],
['openssl_fips != ""', {
'OPENSSL_PRODUCT': 'libcrypto.a',
Expand Down
2 changes: 1 addition & 1 deletion node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
['OS in "linux freebsd" and node_shared=="false"', {
'ldflags': [
'-Wl,--whole-archive,'
'<(PRODUCT_DIR)/obj.target/deps/openssl/'
'<(OBJ_DIR)/deps/openssl/'
'<(OPENSSL_PRODUCT)',
'-Wl,--no-whole-archive',
],
Expand Down

0 comments on commit 9c45758

Please sign in to comment.