File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -561,9 +561,22 @@ def do_custom_build(self):
561561 </PropertyGroup>
562562</Project>
563563""" )
564+ # It is not a trivial task to determine PlatformToolset to plug it
565+ # into msbuild command, and Directory.Build.props will not override
566+ # the value in the project file.
567+ # The DefaultPlatformToolset is from Microsoft.Cpp.Default.props
568+ with open (base_path / vc / "freetype.vcxproj" , 'r+b' ) as f :
569+ toolset_repl = b'PlatformToolset>$(DefaultPlatformToolset)<'
570+ vcxproj = f .read ().replace (b'PlatformToolset>v100<' ,
571+ toolset_repl )
572+ assert toolset_repl in vcxproj , (
573+ 'Upgrading Freetype might break this' )
574+ f .seek (0 )
575+ f .truncate ()
576+ f .write (vcxproj )
577+
564578 cc = ccompiler .new_compiler ()
565- cc .initialize () # Get devenv & msbuild in the %PATH% of cc.spawn.
566- cc .spawn (["devenv" , str (sln_path ), "/upgrade" ])
579+ cc .initialize () # Get msbuild in the %PATH% of cc.spawn.
567580 cc .spawn (["msbuild" , str (sln_path ),
568581 "/t:Clean;Build" ,
569582 f"/p:Configuration=Release;Platform={ msbuild_platform } " ])
You can’t perform that action at this time.
0 commit comments