summaryrefslogtreecommitdiff
path: root/vcbuild.bat
diff options
context:
space:
mode:
authorJason Ginchereau <jasongin@microsoft.com>2017-03-20 14:55:26 -0700
committerAnna Henningsen <anna@addaleax.net>2017-04-03 10:31:25 +0200
commit56e881d0b0b2997b518753cb627eb3b50eeb6f62 (patch)
tree2afceb1396a65a5267fcbd129085752348d79d3e /vcbuild.bat
parent6481c93aefdc9072edfb2db9cee8fa7c42ec2f43 (diff)
downloadandroid-node-v8-56e881d0b0b2997b518753cb627eb3b50eeb6f62.tar.gz
android-node-v8-56e881d0b0b2997b518753cb627eb3b50eeb6f62.tar.bz2
android-node-v8-56e881d0b0b2997b518753cb627eb3b50eeb6f62.zip
n-api: add support for abi stable module API
Add support for abi stable module API (N-API) as "Experimental feature". The goal of this API is to provide a stable Node API for native module developers. N-API aims to provide ABI compatibility guarantees across different Node versions and also across different Node VMs - allowing N-API enabled native modules to just work across different versions and flavors of Node.js without recompilation. A more detailed introduction is provided in: https://github.com/nodejs/node-eps/blob/master/005-ABI-Stable-Module-API.md and https://github.com/nodejs/abi-stable-node/blob/doc/VM%20Summit.pdf. The feature, during its experimental state, will be guarded by a runtime flag "--napi-modules". Only when this flag is added to the command line will N-API modules along with regular non N-API modules be supported. The API is defined by the methods in "src/node_api.h" and "src/node_api_types.h". This is the best starting point to review the API surface. More documentation will follow. In addition to the implementation of the API using V8, which is included in this PR, the API has also been validated against chakracore and that port is available in https://github.com/nodejs/abi-stable-node/tree/api-prototype-chakracore-8.x. The current plan is to provide N-API support in versions 8.X and 6.X directly. For older versions, such as 4.X or pre N-API versions of 6.X, we plan to create an external npm module to provide a migration path that will allow modules targeting older Node.js versions to use the API, albeit without getting the advantage of not having to recompile. In addition, we also plan an external npm package with C++ sugar to simplify the use of the API. The sugar will be in-line only and will only use the exported N-API methods but is not part of the N-API itself. The current version is in: https://github.com/nodejs/node-api. This PR is a result of work in the abi-stable-node repo: https://github.com/nodejs/abi-stable-node/tree/doc, with this PR being the cumulative work on the api-prototype-8.x branch with the following contributors in alphabetical order: Author: Arunesh Chandra <arunesh.chandra@microsoft.com> Author: Gabriel Schulhof <gabriel.schulhof@intel.com> Author: Hitesh Kanwathirtha <hiteshk@microsoft.com> Author: Ian Halliday <ianhall@microsoft.com> Author: Jason Ginchereau <jasongin@microsoft.com> Author: Michael Dawson <michael_dawson@ca.ibm.com> Author: Sampson Gao <sampsong@ca.ibm.com> Author: Taylor Woll <taylor.woll@microsoft.com> PR-URL: https://github.com/nodejs/node/pull/11975 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'vcbuild.bat')
-rw-r--r--vcbuild.bat30
1 files changed, 25 insertions, 5 deletions
diff --git a/vcbuild.bat b/vcbuild.bat
index 9cbac9088f..985b7f1fcc 100644
--- a/vcbuild.bat
+++ b/vcbuild.bat
@@ -40,6 +40,7 @@ set enable_vtune_arg=
set configure_flags=
set build_addons=
set dll=
+set build_addons_napi=
set test_node_inspect=
:next-arg
@@ -59,9 +60,10 @@ if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok
if /i "%1"=="noetw" set noetw=1&goto arg-ok
if /i "%1"=="noperfctr" set noperfctr=1&goto arg-ok
if /i "%1"=="licensertf" set licensertf=1&goto arg-ok
-if /i "%1"=="test" set test_args=%test_args% addons doctool known_issues message parallel sequential -J&set cpplint=1&set jslint=1&set build_addons=1&goto arg-ok
-if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap addons doctool inspector known_issues message sequential parallel&set cctest_args=%cctest_args% --gtest_output=tap:cctest.tap&set build_addons=1&goto arg-ok
+if /i "%1"=="test" set test_args=%test_args% addons addons-napi doctool known_issues message parallel sequential -J&set cpplint=1&set jslint=1&set build_addons=1&set build_addons_napi=1&goto arg-ok
+if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap addons addons-napi doctool inspector known_issues message sequential parallel&set cctest_args=%cctest_args% --gtest_output=tap:cctest.tap&set build_addons=1&set build_addons_napi=1&goto arg-ok
if /i "%1"=="test-addons" set test_args=%test_args% addons&set build_addons=1&goto arg-ok
+if /i "%1"=="test-addons-napi" set test_args=%test_args% addons-napi&set build_addons_napi=1&goto arg-ok
if /i "%1"=="test-simple" set test_args=%test_args% sequential parallel -J&goto arg-ok
if /i "%1"=="test-message" set test_args=%test_args% message&goto arg-ok
if /i "%1"=="test-gc" set test_args=%test_args% gc&set build_testgc_addon=1&goto arg-ok
@@ -312,12 +314,12 @@ echo Failed to build test/gc add-on."
goto exit
:build-addons
-if not defined build_addons goto run-tests
+if not defined build_addons goto build-addons-napi
if not exist "%node_exe%" (
echo Failed to find node.exe
- goto run-tests
+ goto build-addons-napi
)
-echo Building add-ons
+echo Building addons
:: clear
for /d %%F in (test\addons\??_*) do (
rd /s /q %%F
@@ -333,6 +335,24 @@ for /d %%F in (test\addons\*) do (
--nodedir="%cd%"
if !errorlevel! neq 0 exit /b !errorlevel!
)
+
+:build-addons-napi
+if not defined build_addons_napi goto run-tests
+if not exist "%node_exe%" (
+ echo Failed to find node.exe
+ goto run-tests
+)
+echo Building addons-napi
+:: clear
+for /d %%F in (test\addons-napi\??_*) do (
+ rd /s /q %%F
+)
+:: building addons-napi
+for /d %%F in (test\addons-napi\*) do (
+ "%node_exe%" deps\npm\node_modules\node-gyp\bin\node-gyp rebuild ^
+ --directory="%%F" ^
+ --nodedir="%cd%"
+)
endlocal
goto run-tests