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

Commit

Permalink
gyp: Support to build with chakracore for ARM
Browse files Browse the repository at this point in the history
* Support building node.js with chakracore on Windows on ARM
* Building chakracore for ARM has a dependency on Windows SDK installed
on the machine. Update python script to populate
`WindowsSDKDesktopARMSupport` and `WindowsTargetPlatformVersion`
for ARM builds by configuring msvs_windows_target_platform_version. This
will be used in `chakracore.gyp` to pass as parameter to `msbuild.exe`.
  • Loading branch information
kunalspathak committed Feb 11, 2016
1 parent 78e9c74 commit 3a09525
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tools/gyp/pylib/gyp/generator/msvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,22 @@ def _ConfigFullName(config_name, config_data):
return '%s|%s' % (_ConfigBaseName(config_name, platform_name), platform_name)


def _ConfigWindowsTargetPlatformVersion(config_data):
ver = config_data.get('msvs_windows_target_platform_version')
if not ver or re.match(r'^\d+', ver):
return ver
for key in [r'HKLM\Software\Microsoft\Microsoft SDKs\Windows\%s',
r'HKLM\Software\Wow6432Node\Microsoft\Microsoft SDKs\Windows\%s']:
sdkdir = MSVSVersion._RegistryGetValue(key % ver, 'InstallationFolder')
if not sdkdir:
continue
version = MSVSVersion._RegistryGetValue(key % ver, 'ProductVersion') or ''
# find a matching entry in sdkdir\include
names = sorted([x for x in os.listdir(r'%s\include' % sdkdir) \
if x.startswith(version)], reverse = True)
return names[0]


def _BuildCommandLineForRuleRaw(spec, cmd, cygwin_shell, has_input_path,
quote_cmd, do_setup_env):

Expand Down Expand Up @@ -2664,6 +2680,22 @@ def _GetMSBuildGlobalProperties(spec, guid, gyp_file_name):
else:
properties[0].append(['ApplicationType', 'Windows Store'])

platform_name = None
msvs_windows_target_platform_version = None
for configuration in spec['configurations'].itervalues():
platform_name = platform_name or _ConfigPlatform(configuration)
msvs_windows_target_platform_version = \
msvs_windows_target_platform_version or \
_ConfigWindowsTargetPlatformVersion(configuration)
if platform_name and msvs_windows_target_platform_version:
break

if platform_name == 'ARM':
properties[0].append(['WindowsSDKDesktopARMSupport', 'true'])
if msvs_windows_target_platform_version:
properties[0].append(['WindowsTargetPlatformVersion', \
str(msvs_windows_target_platform_version)])

return properties

def _GetMSBuildConfigurationDetails(spec, build_file):
Expand Down

0 comments on commit 3a09525

Please sign in to comment.