scrcpy: Cant build it on windows...

Hello! Can anyone update the build instruction for Windows? I’ve been trying to build the application for several hours, and constantly some errors, mainly due to the fact that nowhere is it written what and from which repositories you need to install, for example, not a word about mason, and as I understand it, it is needed for building, the same is with gradle and maybe something else, but I don’t understand anything about Linux. I’ve fixed a bunch of problems with the PATH environment, but maybe I’m missing something else. Now I have a problem with the first line of this code:

VERSION: = $ (shell git describe --tags --always)
WIN32_TARGET: = $ (WIN32_TARGET_DIR) - $ (VERSION) .zip
WIN64_TARGET: = $ (WIN64_TARGET_DIR) - $ (VERSION) .zip

As I understand it, there should be something like “1.6”, but I have an error “git repo not found”… After manually fixing it, I get the following output with a mason error “meson.build:1:0: ERROR: Unknown compiler(s): [‘cc’, ‘gcc’, ‘clang’, ‘pgcc’, ‘icc’]” that I don’t know how to solve:

# make -f Makefile.CrossWindows
./gradlew clean

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 629ms
2 actionable tasks: 2 up-to-date
rm -rf "build-server" "build-win32" "build-win64" \
           "build-win32-noconsole" "build-win64-noconsole" "dist"
[ -d "build-server" ] || ( mkdir "build-server" && \
        meson "build-server" \
                --buildtype release -Dcompile_app=false )
The Meson build system
Version: 0.55.1
Source dir: /c/Users/user/Desktop/scrcpy-1.16
Build dir: /c/Users/user/Desktop/scrcpy-1.16/build-server
Build type: native build
Using 'PKG_CONFIG_PATH' from environment with value: '/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig'
Using 'PKG_CONFIG_PATH' from environment with value: '/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig'
Project name: scrcpy
Project version: 1.16

meson.build:1:0: ERROR: Unknown compiler(s): ['cc', 'gcc', 'clang', 'pgcc', 'icc']
The follow exceptions were encountered:
Running "cc --version" gave "[Errno 2] No such file or directory: 'cc'"
Running "gcc --version" gave "[Errno 2] No such file or directory: 'gcc'"
Running "clang --version" gave "[Errno 2] No such file or directory: 'clang'"
Running "pgcc --version" gave "[Errno 2] No such file or directory: 'pgcc'"
Running "icc --version" gave "[Errno 2] No such file or directory: 'icc'"

A full log can be found at /c/Users/user/Desktop/scrcpy-1.16/build-server/meson-logs/meson-log.txt
make: *** [Makefile.CrossWindows:45: build-server] Error 1

About this issue

Most upvoted comments

In the MSYS2 folder, IIUC there is MSYS2.exe and mingw64.exe. The correct one is the latter.