Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit 1c364f5

Browse files
digitalinfinitykfarnung
authored andcommitted
build: chakracore build improvements
Makes the following improvements to node-chakracore builds: - Support ChakraCore test builds - Support ChakraCore builds using ninja PR-URL: #300 Reviewed-By: Kyle Farnung <kfarnung@microsoft.com> Reviewed-By: Kunal Pathak <kpathak@microsoft.com> Reviewed-By: Joao Reis <reis@janeasystems.com>
1 parent 13230d4 commit 1c364f5

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed

configure

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,18 @@ parser.add_option('--engine',
475475
default='chakracore',
476476
help='Use specified JS engine (default is ChakraCore)')
477477

478+
parser.add_option('--chakracore-test-build',
479+
action='store_true',
480+
dest='chakracore_test_build',
481+
default=False,
482+
help='Build "test" build of ChakraCore (requires engine to be ChakraCore)')
483+
484+
parser.add_option('--chakracore-ninja-build',
485+
action='store_true',
486+
dest='chakracore_ninja_build',
487+
default=False,
488+
help='Enable build of ChakraCore using ninja (requires engine to be ChakraCore)')
489+
478490
parser.add_option('--shared',
479491
action='store_true',
480492
dest='shared',
@@ -1320,6 +1332,15 @@ def configure_engine(o):
13201332
o['variables']['node_engine'] = engine
13211333
if engine != 'v8':
13221334
o['variables']['node_use_bundled_v8'] = b(False)
1335+
if engine == 'chakracore':
1336+
o['variables']['chakracore_build_config'] = o['default_configuration']
1337+
if options.chakracore_test_build:
1338+
o['variables']['chakracore_build_config'] = 'Test'
1339+
if options.chakracore_ninja_build:
1340+
o['variables']['chakracore_parallel_build_flags'] = [ "--ninja" ]
1341+
else:
1342+
o['variables']['chakracore_parallel_build_flags'] = []
1343+
13231344

13241345
output = {
13251346
'variables': {},

deps/chakrashim/chakracore.gyp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
'chakra_libs_absolute%': '',
1212

1313
# xplat (non-win32) only
14-
'chakra_config': 'Release', # Debug, Release
14+
'chakra_config': '<(chakracore_build_config)', # Debug, Release, Test
1515

1616
'conditions': [
1717
['target_arch=="ia32"', { 'Platform': 'x86' }],
@@ -24,8 +24,10 @@
2424
}],
2525

2626
# xplat (non-win32) only
27-
['chakra_config=="Debug"', {
27+
['chakracore_build_config=="Debug"', {
2828
'chakra_build_flags': [ '-d' ],
29+
}, 'chakracore_build_config=="Test"', {
30+
'chakra_build_flags': [ '-t' ],
2931
}, {
3032
'chakra_build_flags': [],
3133
}],
@@ -57,7 +59,7 @@
5759
],
5860

5961
'chakracore_win_bin_dir':
60-
'<(chakra_dir)/build/vcbuild/bin/<(Platform)_$(ConfigurationName)',
62+
'<(chakra_dir)/build/vcbuild/bin/<(Platform)_<(chakracore_build_config)',
6163
'xplat_dir': '<(chakra_dir)/out/<(chakra_config)',
6264
'chakra_libs_absolute': '<(PRODUCT_DIR)/../../deps/chakrashim/<(xplat_dir)',
6365

@@ -107,7 +109,7 @@
107109
'action': [
108110
'msbuild',
109111
'/p:Platform=<(Platform)',
110-
'/p:Configuration=$(ConfigurationName)',
112+
'/p:Configuration=<(chakracore_build_config)',
111113
'/p:RuntimeLib=<(component)',
112114
'/p:AdditionalPreprocessorDefinitions=COMPILE_DISABLE_Simdjs=1',
113115
'/m',
@@ -119,6 +121,7 @@
119121
'<(chakra_dir)/build.sh',
120122
'--without=Simdjs',
121123
'--static',
124+
'<@(chakracore_parallel_build_flags)',
122125
'<@(chakra_build_flags)',
123126
'<@(icu_args)',
124127
'--libs-only'

vcbuild.bat

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,16 @@ set enable_static=
4444
set build_addons_napi=
4545
set test_node_inspect=
4646
set test_check_deopts=
47+
set engine=chakracore
48+
set chakracore_test_build=
4749
set js_test_suites=inspector known_issues message parallel sequential
4850
set "common_test_suites=%js_test_suites% doctool addons addons-napi&set build_addons=1&set build_addons_napi=1"
49-
set engine=chakracore
5051

5152
:next-arg
5253
if "%1"=="" goto args-done
5354
if /i "%1"=="debug" set config=Debug&goto arg-ok
5455
if /i "%1"=="release" set config=Release&goto arg-ok
56+
if /i "%1"=="chakracoretest" set config=Release&set chakracore_test_build=1&goto arg-ok
5557
if /i "%1"=="clean" set target=Clean&goto arg-ok
5658
if /i "%1"=="ia32" set target_arch=x86&goto arg-ok
5759
if /i "%1"=="x86" set target_arch=x86&goto arg-ok
@@ -130,6 +132,7 @@ set "node_exe=%~dp0%config%\node.exe"
130132
if not defined native_node_exe set "native_node_exe=%node_exe%"
131133

132134
if "%config%"=="Debug" set configure_flags=%configure_flags% --debug
135+
if "%chakracore_test_build%"=="1" set configure_flags=%configure_flags% --chakracore-test-build
133136
if defined nosnapshot set configure_flags=%configure_flags% --without-snapshot
134137
if defined noetw set configure_flags=%configure_flags% --without-etw& set noetw_msi_arg=/p:NoETW=1
135138
if defined noperfctr set configure_flags=%configure_flags% --without-perfctr& set noperfctr_msi_arg=/p:NoPerfCtr=1

0 commit comments

Comments
 (0)