This repository has been archived by the owner on Oct 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: build with chakrashim/chakracore
Enable building Node.js with chakracore engine. Below are details: * Configure to build Node.js with "v8" (default) or "chakracore" JS engine with optional vcbuild.bat switch. * Support building on Windows on ARM. * chakrashim uses js2c with a namespace. * Configure msvs_windows_target_platform_version to use the right Windows SDK. * Configure msvs_use_library_dependency_inputs to export symbols correctly (otherwise functions not used by node.exe but might be needed by native addon modules could be optimized away by linker). * Configure WindowsSDKDesktopARMSupport for ARM. * Enables building native addon modules for Node.js with multiple node-engines.
- Loading branch information
1 parent
8a8c98c
commit 12cc5d9
Showing
13 changed files
with
444 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
'variables': { | ||
'target_arch%': 'ia32', | ||
'library%': 'static_library', # build chakracore as static library or dll | ||
'component%': 'static_library', # link crt statically or dynamically | ||
'chakra_dir%': 'core', | ||
'msvs_windows_target_platform_version_prop': '', | ||
|
||
'conditions': [ | ||
['target_arch=="ia32"', { 'Platform': 'x86' }], | ||
['target_arch=="x64"', { 'Platform': 'x64' }], | ||
['target_arch=="arm"', { | ||
'Platform': 'arm', | ||
'msvs_windows_target_platform_version_prop': | ||
'/p:WindowsTargetPlatformVersion=$(WindowsTargetPlatformVersion)', | ||
}], | ||
], | ||
}, | ||
|
||
'targets': [ | ||
{ | ||
'target_name': 'chakracore', | ||
'toolsets': ['host'], | ||
'type': 'none', | ||
|
||
'variables': { | ||
'chakracore_sln': '<(chakra_dir)/build/Chakra.Core.sln', | ||
'chakracore_header': [ | ||
'<(chakra_dir)/lib/jsrt/chakracore.h', | ||
'<(chakra_dir)/lib/jsrt/chakracommon.h' | ||
], | ||
'chakracore_binaries': [ | ||
'<(chakra_dir)/build/vcbuild/bin/<(Platform)_$(ConfigurationName)/chakracore.dll', | ||
'<(chakra_dir)/build/vcbuild/bin/<(Platform)_$(ConfigurationName)/chakracore.pdb', | ||
'<(chakra_dir)/build/vcbuild/bin/<(Platform)_$(ConfigurationName)/chakracore.lib', | ||
], | ||
}, | ||
|
||
'actions': [ | ||
{ | ||
'action_name': 'build_chakracore', | ||
'inputs': [ | ||
'<(chakracore_sln)' | ||
], | ||
'outputs': [ | ||
'<@(chakracore_binaries)', | ||
], | ||
'action': [ | ||
'msbuild', | ||
'/p:Platform=<(Platform)', | ||
'/p:Configuration=$(ConfigurationName)', | ||
'/p:RuntimeLib=<(component)', | ||
'<(msvs_windows_target_platform_version_prop)', | ||
'/m', | ||
'<@(_inputs)', | ||
], | ||
}, | ||
], | ||
|
||
'copies': [ | ||
{ | ||
'destination': 'include', | ||
'files': [ '<@(chakracore_header)' ], | ||
}, | ||
{ | ||
'destination': '<(PRODUCT_DIR)', | ||
'files': [ '<@(chakracore_binaries)' ], | ||
}, | ||
], | ||
|
||
'direct_dependent_settings': { | ||
'library_dirs': [ '<(PRODUCT_DIR)' ], | ||
}, | ||
|
||
}, # end chakracore | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
{ | ||
'variables': { | ||
'library_files': [ | ||
'lib/chakra_shim.js', | ||
], | ||
}, | ||
|
||
'targets': [ | ||
{ | ||
'target_name': 'chakrashim', | ||
'type': '<(library)', | ||
|
||
'dependencies': [ | ||
'chakra_js2c#host', | ||
], | ||
|
||
'include_dirs': [ | ||
'include', | ||
'<(SHARED_INTERMEDIATE_DIR)' | ||
], | ||
'defines': [ | ||
'BUILDING_CHAKRASHIM=1', | ||
], | ||
'conditions': [ | ||
[ 'target_arch=="ia32"', { 'defines': [ '__i386__=1' ] } ], | ||
[ 'target_arch=="x64"', { 'defines': [ '__x86_64__=1' ] } ], | ||
[ 'target_arch=="arm"', { 'defines': [ '__arm__=1' ] } ], | ||
['node_engine=="chakracore"', { | ||
'dependencies': [ | ||
'chakracore.gyp:chakracore#host', | ||
], | ||
'export_dependent_settings': [ | ||
'chakracore.gyp:chakracore#host', | ||
], | ||
}], | ||
], | ||
'msvs_use_library_dependency_inputs': 1, | ||
|
||
'direct_dependent_settings': { | ||
'include_dirs': [ | ||
'include', | ||
], | ||
'defines': [ | ||
'BUILDING_CHAKRASHIM=1', | ||
], | ||
'libraries': [ | ||
'-lole32.lib', | ||
'-lversion.lib', | ||
'<@(node_engine_libs)', | ||
], | ||
'conditions': [ | ||
[ 'target_arch=="arm"', { | ||
'defines': [ '__arm__=1' ] | ||
}], | ||
], | ||
}, | ||
|
||
'sources': [ | ||
'include/libplatform/libplatform.h', | ||
'include/v8.h', | ||
'include/v8config.h', | ||
'include/v8-debug.h', | ||
'include/v8-platform.h', | ||
'include/v8-profiler.h', | ||
'include/v8-version.h', | ||
'src/jsrtcachedpropertyidref.inc', | ||
'src/jsrtcontextcachedobj.inc', | ||
'src/jsrtcontextshim.cc', | ||
'src/jsrtcontextshim.h', | ||
'src/jsrtisolateshim.cc', | ||
'src/jsrtisolateshim.h', | ||
'src/jsrtpromise.cc', | ||
'src/jsrtproxyutils.cc', | ||
'src/jsrtproxyutils.h', | ||
'src/jsrtstringutils.cc', | ||
'src/jsrtstringutils.h', | ||
'src/jsrtutils.cc', | ||
'src/jsrtutils.h', | ||
'src/v8array.cc', | ||
'src/v8arraybuffer.cc', | ||
'src/v8boolean.cc', | ||
'src/v8booleanobject.cc', | ||
'src/v8chakra.h', | ||
'src/v8context.cc', | ||
'src/v8date.cc', | ||
'src/v8debug.cc', | ||
'src/v8exception.cc', | ||
'src/v8external.cc', | ||
'src/v8function.cc', | ||
'src/v8functiontemplate.cc', | ||
'src/v8global.cc', | ||
'src/v8handlescope.cc', | ||
'src/v8int32.cc', | ||
'src/v8integer.cc', | ||
'src/v8isolate.cc', | ||
'src/v8message.cc', | ||
'src/v8number.cc', | ||
'src/v8numberobject.cc', | ||
'src/v8object.cc', | ||
'src/v8objecttemplate.cc', | ||
'src/v8persistent.cc', | ||
'src/v8script.cc', | ||
'src/v8signature.cc', | ||
'src/v8stacktrace.cc', | ||
'src/v8string.cc', | ||
'src/v8stringobject.cc', | ||
'src/v8template.cc', | ||
'src/v8trycatch.cc', | ||
'src/v8typedarray.cc', | ||
'src/v8uint32.cc', | ||
'src/v8v8.cc', | ||
'src/v8value.cc', | ||
], | ||
}, # end chakrashim | ||
|
||
{ | ||
'target_name': 'chakra_js2c', | ||
'type': 'none', | ||
'toolsets': ['host'], | ||
'msvs_disabled_warnings': [4091], | ||
'actions': [ | ||
{ | ||
'action_name': 'chakra_js2c', | ||
'inputs': [ | ||
'<@(library_files)' | ||
], | ||
'outputs': [ | ||
'<(SHARED_INTERMEDIATE_DIR)/chakra_natives.h', | ||
], | ||
'action': [ | ||
'<(python)', | ||
'./../../tools/js2c.py', | ||
'--namespace=jsrt', | ||
'<@(_outputs)', | ||
'<@(_inputs)', | ||
], | ||
}, | ||
], | ||
}, # end chakra_js2c | ||
], | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Prefer
dict
literals,return {'__ARM_ARCH_7__': True, '__ARM_NEON__': True}