[FFmpeg-devel] [PATCH 1/1] Enable building with WSL and MSVC

Julio C. Rocha dev at rocha.red
Mon Oct 10 11:02:52 EEST 2022


On Sat, Oct 8, 2022 at 4:37 PM Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:

> Am Sa., 8. Okt. 2022 um 10:39 Uhr schrieb Julio C. Rocha <dev at rocha.red>:
> >
> > On Sun, Oct 2, 2022 at 4:48 PM Julio C. Rocha <dev at rocha.red> wrote:
> >
> > > ---
> > >  configure | 7 ++++++-
> > >  1 file changed, 6 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/configure b/configure
> > > index 6712d045d9..f5f5eb29dd 100755
> > > --- a/configure
> > > +++ b/configure
> > > @@ -4847,7 +4847,12 @@ probe_cc(){
> > >          else
> > >              _ident=$($_cc --version 2>/dev/null | head -n1 | tr -d
> '\r')
> > >          fi
> > > -        _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 |
> > > awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if
> > > (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
> > > +        if [ "$(grep -i Microsoft /proc/version)" ]; then
> > > +            # Windows Subsystem for Linux
> > > +            _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $<
> 2>&1
> > > | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if
> > > (!match($$0, / /)) { cmd="/usr/bin/wslpath \x27" $$0 "\x27"; cmd |&
> getline
> > > pth; print "$@:", pth } }'\'' > $(@:.o=.d)'
> > > +        else
> > > +            _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $<
> 2>&1
> > > | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if
> > > (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
> > > +        fi
> > >          _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
> > >          _cflags_speed="-O2"
> > >          _cflags_size="-O1"
> > > --
> > > 2.37.0 (Apple Git-136)
> > >
> > >
> > Hi! I'd like to re-request feedback for this patch.
> >
> > To clarify, it allows building FFmpeg using MSVC over WSL, without any
> > dependency on MinGW or MSYS.
>
> Hi Carl.
I'm new to building FFmpeg, so need to make some follow-up questions.


> You write in your own explanations "Succeeds" - this and what the patch
> is meant to fix are missing from your commit message.
>
Should I resubmit the patch from scratch with an improved commit message?


> Your patch would not work here - sadly, cl.exe does not print "including"
> for all installations.
>
Can you please elaborate?
If I understand correctly, you are saying older versions of CL.EXE would
not print "including".
Wouldn't that also be an issue for the non-WSL case currently existing in
the configure script?:
else
            _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 |
awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if
(!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'

To finish this point, what sort of installations would fail with the
proposed patch?


> I build FFmpeg regularly with wsl and msvc and others do as well.
> Dependency files are simply empty here (because cl.exe prints
> "Einlesen der Datei" here).

Do you still rely on msys/mingw packages?
This patch tries to address this by removing such dependency.
How can I configure FFmpeg to ignore/leave empty the dependency files?


> Dependency generation works for me with --dep-cc=clang-cl.exe but
> I normally just build without it.
>
> Using clang-cl may not be an option when the software to be integrated
with a specific FFmpeg build expects binary compatibility with plain MSVC.

Looking forward to applying the suggestions once clarified.


More information about the ffmpeg-devel mailing list