Skip to content

Commit 25df3c1

Browse files
committed
build,win: put all compilation artifacts into out
* Add symlink from Release to out\Release for backward compat PR-URL: #27149 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
1 parent 7b85495 commit 25df3c1

File tree

6 files changed

+51
-36
lines changed

6 files changed

+51
-36
lines changed

.gitignore

+3-7
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,19 @@ coverage/
4141

4242
/out
4343

44-
# various stuff that VC++ produces/uses
45-
Debug/
46-
!**/node_modules/debug/
47-
Release/
48-
!**/node_modules/**/release
44+
# various stuff that VC++ produces/uses and is not in /out
45+
/Debug/
46+
/Release/
4947
!doc/blog/**
5048
*.sln
5149
!nodemsi.sln
5250
*.suo
53-
*.vcproj
5451
*.vcxproj
5552
!custom_actions.vcxproj
5653
*.vcxproj.user
5754
*.vcxproj.filters
5855
UpgradeLog*.XML
5956
_UpgradeReport_Files/
60-
ipch/
6157
*.sdf
6258
*.opensdf
6359
*.VC.db

common.gypi

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
'variables': {
3+
'configuring_node%': 0,
34
'asan%': 0,
45
'werror': '', # Turn off -Werror in V8 build.
56
'visibility%': 'hidden', # V8's visibility setting
@@ -280,6 +281,12 @@
280281
'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
281282

282283
'conditions': [
284+
[ 'configuring_node', {
285+
'msvs_configuration_attributes': {
286+
'OutputDirectory': '<(DEPTH)/out/$(Configuration)/',
287+
'IntermediateDirectory': '$(OutDir)obj/$(ProjectName)/'
288+
},
289+
}],
283290
[ 'target_arch=="x64"', {
284291
'msvs_configuration_platform': 'x64',
285292
}],

configure.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,7 @@ def make_bin_override():
16251625

16261626
write('config.mk', do_not_edit + config)
16271627

1628-
gyp_args = ['--no-parallel']
1628+
gyp_args = ['--no-parallel', '-Dconfiguring_node=1']
16291629

16301630
if options.use_ninja:
16311631
gyp_args += ['-f', 'ninja']

node.gyp

+25
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,31 @@
251251
],
252252
},
253253

254+
'target_defaults': {
255+
# Putting these explicitly here so not to depend on `common.gypi`.
256+
# `common.gypi` need to be more general because it is used to build userland native addons.
257+
# Refs: https://github.com/nodejs/node-gyp/issues/1118
258+
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
259+
'xcode_settings': {
260+
'WARNING_CFLAGS': [
261+
'-Wall',
262+
'-Wendif-labels',
263+
'-W',
264+
'-Wno-unused-parameter',
265+
'-Werror=undefined-inline',
266+
],
267+
},
268+
269+
# Relevant only for x86.
270+
# Refs: https://github.com/nodejs/node/pull/25852
271+
# Refs: https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers
272+
'msvs_settings': {
273+
'VCLinkerTool': {
274+
'ImageHasSafeExceptionHandlers': 'false',
275+
},
276+
},
277+
},
278+
254279
'targets': [
255280
{
256281
'target_name': '<(node_core_target_name)',

node.gypi

+4-20
Original file line numberDiff line numberDiff line change
@@ -24,36 +24,20 @@
2424
},
2525
'force_load%': '<(force_load)',
2626
},
27-
# Putting these explicitly here so not to be dependant on common.gypi.
28-
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
29-
'xcode_settings': {
30-
'WARNING_CFLAGS': [
31-
'-Wall',
32-
'-Wendif-labels',
33-
'-W',
34-
'-Wno-unused-parameter',
35-
'-Werror=undefined-inline',
36-
],
37-
},
38-
# Relevant only for x86.
39-
# Refs: https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers
40-
'msvs_settings': {
41-
'VCLinkerTool': {
42-
'ImageHasSafeExceptionHandlers': 'false',
43-
},
44-
},
27+
4528
'conditions': [
4629
[ 'clang==1', {
4730
'cflags': [ '-Werror=undefined-inline', ]
4831
}],
49-
[ 'node_shared=="false"', {
32+
[ 'node_shared=="false" and "<(_type)"=="executable"', {
5033
'msvs_settings': {
5134
'VCManifestTool': {
5235
'EmbedManifest': 'true',
5336
'AdditionalManifestFiles': 'src/res/node.exe.extra.manifest'
5437
}
5538
},
56-
}, {
39+
}],
40+
[ 'node_shared=="true"', {
5741
'defines': [
5842
'NODE_SHARED_MODE',
5943
],

vcbuild.bat

+11-8
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ if not "%target%"=="Clean" goto skip-clean
211211
rmdir /Q /S "%~dp0%config%\%TARGET_NAME%" > nul 2> nul
212212
:skip-clean
213213

214-
if defined noprojgen if defined nobuild if not defined sign if not defined msi goto licensertf
214+
if defined noprojgen if defined nobuild goto :after-build
215215

216216
@rem Set environment for msbuild
217217

@@ -301,7 +301,7 @@ where /R . /T *.gyp? >> .gyp_configure_stamp
301301

302302
:msbuild
303303
@rem Skip build if requested.
304-
if defined nobuild goto sign
304+
if defined nobuild goto :after-build
305305

306306
@rem Build the sln with msbuild.
307307
set "msbcpu=/m:2"
@@ -319,10 +319,13 @@ if defined msbuild_args set "extra_msbuild_args=%extra_msbuild_args% %msbuild_ar
319319
msbuild node.sln %msbcpu% /t:%target% /p:Configuration=%config% /p:Platform=%msbplatform% /clp:NoItemAndPropertyList;Verbosity=minimal /nologo %extra_msbuild_args%
320320
if errorlevel 1 (
321321
if not defined project_generated echo Building Node with reused solution failed. To regenerate project files use "vcbuild projgen"
322-
goto exit
322+
exit /B 1
323323
)
324324
if "%target%" == "Clean" goto exit
325325

326+
:after-build
327+
if EXIST out\%config% mklink /D %config% out\%config%
328+
326329
:sign
327330
@rem Skip signing unless the `sign` option was specified.
328331
if not defined sign goto licensertf
@@ -334,7 +337,7 @@ if errorlevel 1 echo Failed to sign exe&goto exit
334337
@rem Skip license.rtf generation if not requested.
335338
if not defined licensertf goto stage_package
336339

337-
%config%\node.exe tools\license2rtf.js < LICENSE > %config%\license.rtf
340+
%node_exe% tools\license2rtf.js < LICENSE > %config%\license.rtf
338341
if errorlevel 1 echo Failed to generate license.rtf&goto exit
339342

340343
:stage_package
@@ -553,7 +556,7 @@ goto node-tests
553556

554557
:node-test-inspect
555558
set USE_EMBEDDED_NODE_INSPECT=1
556-
%config%\node tools\test-npm-package.js --install deps\node-inspect test
559+
%node_exe% tools\test-npm-package.js --install deps\node-inspect test
557560
goto node-tests
558561

559562
:node-tests
@@ -635,12 +638,12 @@ if defined lint_js_ci goto lint-js-ci
635638
if not defined lint_js goto lint-md-build
636639
if not exist tools\node_modules\eslint goto no-lint
637640
echo running lint-js
638-
%config%\node tools\node_modules\eslint\bin\eslint.js --cache --report-unused-disable-directives --rule "linebreak-style: 0" --ext=.js,.mjs,.md .eslintrc.js benchmark doc lib test tools
641+
%node_exe% tools\node_modules\eslint\bin\eslint.js --cache --report-unused-disable-directives --rule "linebreak-style: 0" --ext=.js,.mjs,.md .eslintrc.js benchmark doc lib test tools
639642
goto lint-md-build
640643

641644
:lint-js-ci
642645
echo running lint-js-ci
643-
%config%\node tools\lint-js.js -J -f tap -o test-eslint.tap benchmark doc lib test tools
646+
%node_exe% tools\lint-js.js -J -f tap -o test-eslint.tap benchmark doc lib test tools
644647
goto lint-md-build
645648

646649
:no-lint
@@ -663,7 +666,7 @@ for /D %%D IN (doc\*) do (
663666
set "lint_md_files="%%F" !lint_md_files!"
664667
)
665668
)
666-
%config%\node tools\lint-md.js -q -f %lint_md_files%
669+
%node_exe% tools\lint-md.js -q -f %lint_md_files%
667670
ENDLOCAL
668671
goto exit
669672

0 commit comments

Comments
 (0)