From 1fde990129b9e89f298b270d3a1631d70e0c6805 Mon Sep 17 00:00:00 2001 From: Kenan Yildirim Date: Mon, 13 Feb 2017 13:31:56 -0500 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/11348 Fixes: https://github.com/nodejs/node/issues/9861 Reviewed-By: Ben Noordhuis Reviewed-By: Sam Roberts Reviewed-By: Gibson Fahnestock Reviewed-By: James M Snell --- common.gypi | 13 ++++++++++--- node.gyp | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/common.gypi b/common.gypi index 0fa36197be97a9..a52915d59a7ac4 100644 --- a/common.gypi +++ b/common.gypi @@ -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', diff --git a/node.gyp b/node.gyp index d14e7ff8f13d62..50d66837a62f33 100644 --- a/node.gyp +++ b/node.gyp @@ -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', ],