Closed huangqinjin closed 1 year ago
- Use ccache depend mode. It doesn't run preprocessor but hash files listed in
/showIncludes
, which we already convert them to unix style paths.
So this would require the user to set some option to make ccache not try to use this mode?
- Postprocess the preprocessor output file: convert to unix style paths. This need implement in
wine-msvc.sh
wrapper.
Hmm. So the wrapper script would intercept any [/-]Fi
option, and if present, do the path name rewriting on lines that look like #line
in that output file? I guess that would work - if it doesn't end up being too much of a mess, I guess this could be acceptable?
So this would require the user to set some option to make ccache not try to use this mode?
Yes. User need define CCACHE_DEPEND
env var, or add depend_mode = true
to ccache.conf
.
Please see proposed https://github.com/mstorsjo/msvc-wine/pull/70.
Background
ccache
has three working modes:/showIncludes
.Problem
The direct mode is always disabled due to accessing
z:/tmp/main.c
.Cause
The output of
/opt/msvc/bin/x64/cl.exe -P /tmp/main.c
is the filemain.i
in CWD if option/Fi
is not present.The paths in the file are not converted to unix style.
ccache
will parse this file and hash the files listed, which is of cause failed, and then direct mode is disabled.Solution
/showIncludes
, which we already convert them to unix style paths. OR,wine-msvc.sh
wrapper. @mstorsjo What's your opinion?