mirror of
https://github.com/Cheviiot/Vintner.git
synced 2026-08-03 15:57:24 +00:00
Fix MSBuild toolset/SDK detection under Wine
msbuild <project>.vcxproj previously failed with MSB8020 ("build tools for
vNNN cannot be found") because MSBuild's own toolset/SDK resolution reads
a different set of environment variables than cl/link/lib do directly
(VCInstallDir_<N>, VCToolsInstallDir_<N>, VsInstallRoot,
WindowsSdkDir_10, WindowsTargetPlatformVersion, DisableRegistryUse, etc) -
none of which the generic INCLUDE/LIB/WINEPATH env covered.
Added msbuildEnv, populated for every MSBuild toolset generation actually
present under MSBuild/Microsoft/VC/v*, and wired into the msbuild wrapper.
Verified end-to-end: msbuild successfully builds ocornut/imgui's
example_win32_directx11.vcxproj (retargeted from its original v141
PlatformToolset to this install's v145) - compiles all 8 sources and
links against d3d11.lib/d3dcompiler.lib/dxgi.lib, producing a valid
PE32+ executable.
This commit is contained in:
@@ -16,6 +16,14 @@ type Paths struct {
|
||||
SDKBinDir string // <dest>/kits/10/bin/<sdkver>/<host> - mc/midl/mt/rc live here
|
||||
MSBuildBinDir string // <dest>/MSBuild/Current/Bin/<dotnetHost> - MSBuild.exe lives here
|
||||
|
||||
// Windows-notation ("z:\...") equivalents of the paths above, needed to
|
||||
// populate the MSBuild-specific environment variables its toolset/SDK
|
||||
// detection props read (see msbuildEnv in the wrapper package).
|
||||
BaseWin string // z:\<dest>
|
||||
MSVCBaseWin string // z:\<dest>\vc
|
||||
MSVCDirWin string // z:\<dest>\vc\tools\msvc\<ver>
|
||||
SDKBaseWin string // z:\<dest>\kits\10
|
||||
|
||||
Include string
|
||||
Lib string
|
||||
LibPath string
|
||||
@@ -89,6 +97,11 @@ func NewPaths(cfg *Config, baseUnix string) *Paths {
|
||||
SDKBinDir: sdkBinDir,
|
||||
MSBuildBinDir: msbuildBinDir,
|
||||
|
||||
BaseWin: winBase,
|
||||
MSVCBaseWin: msvcBase,
|
||||
MSVCDirWin: msvcDirWin,
|
||||
SDKBaseWin: sdkBase,
|
||||
|
||||
Include: include,
|
||||
Lib: lib,
|
||||
LibPath: lib,
|
||||
|
||||
Reference in New Issue
Block a user