Commit graph

15 commits

Author SHA1 Message Date
Romain Vimont
0d050d83b4 Add missing .PHONY in portable Makefile
The recipe "build-portable" is also the name of the generated directory.
Add this name to the .PHONY list.
2018-02-16 15:36:25 +01:00
Romain Vimont
089378926b Rename SCRCPY_SERVER_JAR to SCRCPY_SERVER_PATH
The server is currently a JAR, but it may ba an APK or a DEX, so the
variable name should not contain the type.

Rename the environment variable, the Meson options and the C
definitions.
2018-02-16 15:36:25 +01:00
Romain Vimont
c2127d0819 Replace meson subprojects by subdir
Since Meson 0.44, subproject_dir may not be '.' anymore. This implies we
must move app/ and server/ to a subprojects/ directory, which requires
to also change some gradle files.

Instead, just use subdir(), with options to disable building of the app
or the server.
2018-02-14 14:03:56 +01:00
Romain Vimont
ff94462d8a Refactor build system
The client was built with Meson, the server with Gradle, and were run by
a Makefile.

Add a Meson script for the server (which delegates to Gradle), and a
parent script to build and install both the client and the server to the
system, typically with:

    meson --buildtype release build
    cd build
    ninja
    sudo ninja install

In addition, use a separate Makefile to build a "portable" version of
the application (where the client expects the server to be in the
current directory). Typically:

    make release-portable
    cd dist/scrcpy
    ./scrcpy

This is especially useful for Windows builds, which are not "installed".
2018-02-14 09:23:14 +01:00
Romain Vimont
598ddcbfbc Disable sanitizer on debug builds
On our Windows machine, the mingw ld.exe does not support sanitizers.

Exclude them from the default debug build.
2018-02-12 15:59:27 +01:00
Romain Vimont
2f3e00ed98 Enable link-time optimization for release
Because why not.
2018-02-12 14:17:29 +01:00
Romain Vimont
d658586d0d Enable sanitizer in debug builds
"make build-debug" will build with ASAN and USAN enabled.
2018-02-09 12:12:07 +01:00
Romain Vimont
33062ffb8c Add Makefile recipe for debug build
Expose commands to build the application in debug mode.
2018-02-07 11:47:10 +01:00
Romain Vimont
920bafce73 Revert "Fix Makefile for Windows"
In MSYS2 on Windows, the behavior is the same as on Linux.

On systems where the behavior is not the same, just customize the GRADLE
variable:

    GRADLE=gradlew make release

This reverts commit de192cab1b.
2018-02-05 19:24:00 +01:00
Romain Vimont
de192cab1b Fix Makefile for Windows
The default value of GRADLE is "./gradlew", which is the correct value
on Linux.

On Windows, it should use gradlew.bat (by calling "gradlew") instead.
2018-02-05 14:52:19 +01:00
Romain Vimont
82ee55845c Add "make run"
To run the app during development, add a recipe "run" to the Makefile.
2018-02-04 12:17:34 +01:00
Romain Vimont
1faf6cfd9d Rename the server scrcpy-server.jar
The server is built as an APK to simplify the build, but in fact this is
a simple jar (it is not even signed).

In order to avoid confusion, rename it to .jar, so that users do not try
to "adb install" it.

Also rename it from "scrcpy" to "scrcpy-server" to distinguish from the
client-side.
2018-02-02 09:37:10 +01:00
Romain Vimont
b67907e24e Convert server to an Android project
To simplify the device server-side build, use gradle to create an APK,
even if we use it as a simple jar, by running its main() method.
2018-01-30 12:01:36 +01:00
Romain Vimont
cabb102a04 Implement keyboard/mouse control
To control the device from the computer:
 - retrieve mouse and keyboard SDL events;
 - convert them to Android events;
 - serialize them;
 - send them on the same socket used by the video stream (but in the
 opposite direction);
 - deserialize the events on the Android side;
 - inject them using the InputManager.
2018-01-18 17:25:13 +01:00
Romain Vimont
54d9148a36 Initial commit
Start a new clean history from here.
2017-12-12 15:25:15 +01:00