Skip to content

Commit

Permalink
build,win: put all compilation artifacts into out
Browse files Browse the repository at this point in the history
* Add symlink from Release to out\Release for backward compat

PR-URL: #27149
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
refack committed Apr 12, 2019
1 parent 7b85495 commit 25df3c1
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 36 deletions.
10 changes: 3 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,19 @@ coverage/

/out

# various stuff that VC++ produces/uses
Debug/
!**/node_modules/debug/
Release/
!**/node_modules/**/release
# various stuff that VC++ produces/uses and is not in /out
/Debug/
/Release/
!doc/blog/**
*.sln
!nodemsi.sln
*.suo
*.vcproj
*.vcxproj
!custom_actions.vcxproj
*.vcxproj.user
*.vcxproj.filters
UpgradeLog*.XML
_UpgradeReport_Files/
ipch/
*.sdf
*.opensdf
*.VC.db
Expand Down
7 changes: 7 additions & 0 deletions common.gypi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
'variables': {
'configuring_node%': 0,
'asan%': 0,
'werror': '', # Turn off -Werror in V8 build.
'visibility%': 'hidden', # V8's visibility setting
Expand Down Expand Up @@ -280,6 +281,12 @@
'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin

'conditions': [
[ 'configuring_node', {
'msvs_configuration_attributes': {
'OutputDirectory': '<(DEPTH)/out/$(Configuration)/',
'IntermediateDirectory': '$(OutDir)obj/$(ProjectName)/'
},
}],
[ 'target_arch=="x64"', {
'msvs_configuration_platform': 'x64',
}],
Expand Down
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,7 @@ def make_bin_override():

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

gyp_args = ['--no-parallel']
gyp_args = ['--no-parallel', '-Dconfiguring_node=1']

if options.use_ninja:
gyp_args += ['-f', 'ninja']
Expand Down
25 changes: 25 additions & 0 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,31 @@
],
},

'target_defaults': {
# Putting these explicitly here so not to depend on `common.gypi`.
# `common.gypi` need to be more general because it is used to build userland native addons.
# Refs: https://github.com/nodejs/node-gyp/issues/1118
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
'xcode_settings': {
'WARNING_CFLAGS': [
'-Wall',
'-Wendif-labels',
'-W',
'-Wno-unused-parameter',
'-Werror=undefined-inline',
],
},

# Relevant only for x86.
# Refs: https://github.com/nodejs/node/pull/25852
# Refs: https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers
'msvs_settings': {
'VCLinkerTool': {
'ImageHasSafeExceptionHandlers': 'false',
},
},
},

'targets': [
{
'target_name': '<(node_core_target_name)',
Expand Down
24 changes: 4 additions & 20 deletions node.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,20 @@
},
'force_load%': '<(force_load)',
},
# Putting these explicitly here so not to be dependant on common.gypi.
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
'xcode_settings': {
'WARNING_CFLAGS': [
'-Wall',
'-Wendif-labels',
'-W',
'-Wno-unused-parameter',
'-Werror=undefined-inline',
],
},
# Relevant only for x86.
# Refs: https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers
'msvs_settings': {
'VCLinkerTool': {
'ImageHasSafeExceptionHandlers': 'false',
},
},

'conditions': [
[ 'clang==1', {
'cflags': [ '-Werror=undefined-inline', ]
}],
[ 'node_shared=="false"', {
[ 'node_shared=="false" and "<(_type)"=="executable"', {
'msvs_settings': {
'VCManifestTool': {
'EmbedManifest': 'true',
'AdditionalManifestFiles': 'src/res/node.exe.extra.manifest'
}
},
}, {
}],
[ 'node_shared=="true"', {
'defines': [
'NODE_SHARED_MODE',
],
Expand Down
19 changes: 11 additions & 8 deletions vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ if not "%target%"=="Clean" goto skip-clean
rmdir /Q /S "%~dp0%config%\%TARGET_NAME%" > nul 2> nul
:skip-clean

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

@rem Set environment for msbuild

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

:msbuild
@rem Skip build if requested.
if defined nobuild goto sign
if defined nobuild goto :after-build

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

:after-build
if EXIST out\%config% mklink /D %config% out\%config%

:sign
@rem Skip signing unless the `sign` option was specified.
if not defined sign goto licensertf
Expand All @@ -334,7 +337,7 @@ if errorlevel 1 echo Failed to sign exe&goto exit
@rem Skip license.rtf generation if not requested.
if not defined licensertf goto stage_package

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

:stage_package
Expand Down Expand Up @@ -553,7 +556,7 @@ goto node-tests

:node-test-inspect
set USE_EMBEDDED_NODE_INSPECT=1
%config%\node tools\test-npm-package.js --install deps\node-inspect test
%node_exe% tools\test-npm-package.js --install deps\node-inspect test
goto node-tests

:node-tests
Expand Down Expand Up @@ -635,12 +638,12 @@ if defined lint_js_ci goto lint-js-ci
if not defined lint_js goto lint-md-build
if not exist tools\node_modules\eslint goto no-lint
echo running lint-js
%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
%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
goto lint-md-build

:lint-js-ci
echo running lint-js-ci
%config%\node tools\lint-js.js -J -f tap -o test-eslint.tap benchmark doc lib test tools
%node_exe% tools\lint-js.js -J -f tap -o test-eslint.tap benchmark doc lib test tools
goto lint-md-build

:no-lint
Expand All @@ -663,7 +666,7 @@ for /D %%D IN (doc\*) do (
set "lint_md_files="%%F" !lint_md_files!"
)
)
%config%\node tools\lint-md.js -q -f %lint_md_files%
%node_exe% tools\lint-md.js -q -f %lint_md_files%
ENDLOCAL
goto exit

Expand Down

0 comments on commit 25df3c1

Please sign in to comment.