Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 0e1aa09

Browse files
committed
[[ CodeResources ]] Implement platform_id variable in gyp
This patch implements a `platform_id` variable in gyp that conforms to the platform ID spec.
1 parent 736c2eb commit 0e1aa09

2 files changed

Lines changed: 46 additions & 3 deletions

File tree

common.gypi

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,30 @@
1212
'config/version.gypi',
1313
'config/yacc.gypi',
1414
],
15+
16+
# generate platform ID once all config is included
17+
'variables':
18+
{
19+
'conditions':
20+
[
21+
[
22+
'(OS == "mac" or OS == "ios")',
23+
{
24+
'platform_id': 'universal-<(OS)-<(target_sdk)',
25+
},
26+
],
27+
[
28+
'OS == "win"',
29+
{
30+
'platform_id': '<(uniform_arch)-<(OS)-msvc<(msvs_compiler_version)_<(msvs_crt_mode)',
31+
},
32+
],
33+
[
34+
'OS != "win" and OS != "mac" and OS != "ios"',
35+
{
36+
'platform_id': '<(uniform_arch)-<(OS)',
37+
},
38+
],
39+
],
40+
},
1541
}
16-

config/win32.gypi

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
'debug_info_suffix': '',
2424

2525
'silence_warnings': 0,
26+
'msvs_compiler_version': "141",
2627
},
2728

2829
# Don't assume a Cygwin environment when invoking actions
@@ -31,7 +32,7 @@
3132
# TODO [2017-04-11]: Remove these overrides when we can use
3233
# -Gmsvs_version=2017
3334
"msvs_target_platform_version" : "10.0.14393.0",
34-
"msbuild_toolset" : "v141",
35+
"msbuild_toolset" : "v<(msvs_compiler_version)",
3536

3637
# WIN64-CHECK
3738
'conditions':
@@ -42,13 +43,19 @@
4243
'msvs_target_platform': 'x64',
4344
'msvs_configuration_platform': 'x64',
4445
},
46+
4547
],
4648
],
4749

4850
'configurations':
4951
{
5052
'Debug':
51-
{
53+
{
54+
'variables':
55+
{
56+
'msvs_crt_mode': 'mtd',
57+
},
58+
5259
'msvs_settings':
5360
{
5461
'VCCLCompilerTool':
@@ -86,6 +93,11 @@
8693

8794
'Release':
8895
{
96+
'variables':
97+
{
98+
'msvs_crt_mode': 'mt',
99+
},
100+
89101
'msvs_settings':
90102
{
91103
'VCCLCompilerTool':
@@ -109,6 +121,12 @@
109121

110122
'Fast':
111123
{
124+
125+
'variables':
126+
{
127+
'msvs_crt_mode': 'mt',
128+
},
129+
112130
'msvs_settings':
113131
{
114132
'VCCLCompilerTool':

0 commit comments

Comments
 (0)