Skip to content

Commit bf8459a

Browse files
committed
fixes VCTargetsPath in windows build.
1 parent 16580a7 commit bf8459a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

builder/windows.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,22 @@ def build_commands(_, extra_args, script_dir, lv_cflags, board):
5858
env = pyMSVC.setup_environment()
5959
print(env)
6060

61+
for key in os.environ.keys():
62+
if 'COMNTOOLS' in key:
63+
version = key.replace('COMNTOOLS', '').replace('VS', '')
64+
break
65+
else:
66+
print(os.environ)
67+
raise RuntimeError('unable to locate common tools version')
68+
69+
version = 'v' + version
70+
71+
msbuild_path = env.visual_c.msbuild_path.lower()
72+
msbuild_path = msbuild_path.split('msbuild', 1)[0][:-1]
73+
74+
VCTargetsPath = os.path.join(msbuild_path, 'Msbuild', 'Microsoft', 'VC', version)
75+
os.environ['VCTargetsPath'] = VCTargetsPath
76+
6177
mpy_cross_cmd.extend([
6278
'msbuild',
6379
'lib/micropython/mpy-cross/mpy-cross.vcxproj'

0 commit comments

Comments
 (0)