build,src: add PCH to node.gypi

PR-URL: https://github.com/nodejs/node/pull/25931
Reviewed-By: João Reis <reis@janeasystems.com>
This commit is contained in:
Refael Ackermann 2018-10-13 15:13:43 -04:00
parent 4698757610
commit 6ac80f0e2b
3 changed files with 23 additions and 2 deletions

View File

@ -36,7 +36,7 @@
], ],
}, },
'conditions': [ 'conditions': [
['clang==1', { [ 'clang==1', {
'cflags': [ '-Werror=undefined-inline', ] 'cflags': [ '-Werror=undefined-inline', ]
}], }],
[ 'node_shared=="false"', { [ 'node_shared=="false"', {
@ -68,7 +68,14 @@
}, { # POSIX }, { # POSIX
'defines': [ '__POSIX__' ], 'defines': [ '__POSIX__' ],
}], }],
[ 'node_use_pch=="true"', {
'msvs_precompiled_header': 'tools/msvs/pch/node_pch.h',
'msvs_precompiled_source': 'tools/msvs/pch/node_pch.cc',
'sources': [
'<(_msvs_precompiled_header)',
'<(_msvs_precompiled_source)',
],
}],
[ 'node_enable_d8=="true"', { [ 'node_enable_d8=="true"', {
'dependencies': [ 'deps/v8/gypfiles/d8.gyp:d8' ], 'dependencies': [ 'deps/v8/gypfiles/d8.gyp:d8' ],
}], }],

View File

@ -0,0 +1 @@
#include "node_pch.h"

13
tools/msvs/pch/node_pch.h Normal file
View File

@ -0,0 +1,13 @@
#pragma once
#include "aliased_buffer.h"
#include "base_object-inl.h"
#include "env-inl.h"
#include "node_internals.h"
#include "util-inl.h"
#include "uv.h"
#include "v8.h"
#include <list>
#include <memory>
#include <string>
#include <vector>