mstorsjo / msvc-wine

Scripts for setting up and running MSVC in Wine on Linux
Other
627 stars 80 forks source link

cl preferring WindowsSDK Headers over custom headers. #100

Open KungFuDonkey opened 8 months ago

KungFuDonkey commented 8 months ago

In a project that I am doing I have a custom installation of DirectX and a custom build system. On Windows I ensure that the include folder of this custom DirectX folder is the first in the build command:

cl.exe .... -/external:I "Custom/directx/include" ... -/external:I "path/to/windowsSDK/includes/"

On Windows this allows me to overwrite the DirectX header files, such as d3dcommon.h and d3d12.h, with a custom version from a DirectX branch.

On Linux with msvc-wine I ensured that the same order of cli arguments are given to the cl compiler, however, it prefers the d3dcommon.h and d3d12.h in the WindowsSDK and does not consider my custom header files. I tried to see if the include paths are somehow prepended to my cli arguments, but I was unable to find them.

For now a solution that I have found that works for me is to completely remove the header files from the WindowsSDK, however, this is only a temporary solution as we might need to use the header files of the WindowsSDK in the future.

Is there a way to tell the cl compiler which include path I prefer? Thanks in advance!

PS. AMAZING project man ty very much :)

mstorsjo commented 7 months ago

My main guess here, is that the paths that you pass are in a unix-y form where cl.exe in wine won't resolve it correctly. We do rewrite some paths in some arguments to fix such issues, have a look in wine-msvc.sh - not sure if that's happening here or not.