Skip to content

Commit 49f0d9d

Browse files
authored
Block building for the wrong target arch in Developer Command Prompt (#5731)
1 parent 6d24b53 commit 49f0d9d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

CMakePresets.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"condition": {
2424
"type": "inList",
25-
"string": "$env{Platform}",
25+
"string": "$env{VSCMD_ARG_TGT_ARCH}",
2626
"list": [
2727
"x64",
2828
""
@@ -39,7 +39,7 @@
3939
},
4040
"condition": {
4141
"type": "inList",
42-
"string": "$env{Platform}",
42+
"string": "$env{VSCMD_ARG_TGT_ARCH}",
4343
"list": [
4444
"x86",
4545
""
@@ -56,7 +56,7 @@
5656
},
5757
"condition": {
5858
"type": "inList",
59-
"string": "$env{Platform}",
59+
"string": "$env{VSCMD_ARG_TGT_ARCH}",
6060
"list": [
6161
"arm64",
6262
""
@@ -76,7 +76,7 @@
7676
},
7777
"condition": {
7878
"type": "inList",
79-
"string": "$env{Platform}",
79+
"string": "$env{VSCMD_ARG_TGT_ARCH}",
8080
"list": [
8181
"arm64",
8282
""

tests/utils/stl-lit/stl-lit.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ builtin_parameters= {}
3030
builtin_parameters['config_map'] = config_map
3131

3232
def assert_same_platform_for_build_and_test():
33-
build_platform = '$ENV{Platform}'
34-
test_platform = os.getenv('Platform', default='')
33+
build_platform = '$ENV{VSCMD_ARG_TGT_ARCH}'
34+
test_platform = os.getenv('VSCMD_ARG_TGT_ARCH', default='')
3535
if build_platform != '' and test_platform != '' and build_platform != test_platform:
3636
exit(f'Target platform mismatch: the STL was built for {build_platform} but tested for {test_platform}.')
3737

0 commit comments

Comments
 (0)