Closed TheComputerGuy96 closed 1 week ago
@ravenexp - Do you have any opinions on this?
These variables look like something the MSVC property files for C++ projects would set internally.
See for example MSBuild/Microsoft/VC/v170/Microsoft.Cpp.MSVC.Toolset.Win32.props
.
Rather than overriding these globally, I'd first check if setting UseEnv
solves the problem for the project in question:
@TheComputerGuy96
Does
msbuild /p:UseEnv=true
work for your project?
@ravenexp UseEnv=true
also works (so I set that by default instead)
@ravenexp
UseEnv=true
also works (so I set that by default instead)
It's great that it works, but it should not be set by default because it effectively bypasses all configuration settings from the MSBuild project file.
Can you share your MSBuild project file or maybe just the configuration properties part without the source file names? I'll try to figure out what is missing from the msvc-wine MSBuild environment. I want to try to get to the root cause of this issue.
@ravenexp Here's the .vcxproj file: https://github.com/CookiePLMonster/SilentPatch/blob/dev/DDraw/DDraw.vcxproj
Ah, this must be it:
<PlatformToolset>v141_xp</PlatformToolset>
I've never tried targeting Windows 7, much less XP. I'll try to figure out what env vars are required to support this platform.
I'm currently setting /p:PlatformToolset=v143
option to make that project build (and the SetEnv
option of course)
I'm currently setting
/p:PlatformToolset=v143
option to make that project build (and theSetEnv
option of course)
I've opened https://github.com/mstorsjo/msvc-wine/pull/152 to address the root cause of this bug. With it applied, your project should now build with:
msbuild /p:Platform=Win32 /p:PlatformToolset=v143 /p:WindowsTargetPlatformVersion=10.0
UseEnv
is not required.
@ravenexp I can confirm that MR solves the issue too (with that extra /p:WindowsTargetPlatformVersion=10.0
option; otherwise I get the same build error)
@ravenexp I can confirm that MR solves the issue too (with that extra
/p:WindowsTargetPlatformVersion=10.0
option; otherwise I get the same build error)
Then I suggest closing this in favor of #152, which solves the actual problem that prevented the needed WindowsTargetPlatformVersion
override from working in msvc-wine
.
Superseeded by #152
For some reason default Windows headers and libraries can't be found in an older project without those variables being set