Skip to content

Display and control your Android device

Add static build option

Romain Vimont179c664e2b78
diff --git a/app/meson.build b/app/meson.build
index 444cf98e..f089ffb1 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -109,20 +109,22 @@ endif
cc = meson.get_compiler('c')
+static = get_option('static')
+
dependencies = [
- dependency('libavformat', version: '>= 57.33'),
- dependency('libavcodec', version: '>= 57.37'),
- dependency('libavutil'),
- dependency('libswresample'),
- dependency('sdl2', version: '>= 2.0.5'),
+ dependency('libavformat', version: '>= 57.33', static: static),
+ dependency('libavcodec', version: '>= 57.37', static: static),
+ dependency('libavutil', static: static),
+ dependency('libswresample', static: static),
+ dependency('sdl2', version: '>= 2.0.5', static: static),
]
if v4l2_support
- dependencies += dependency('libavdevice')
+ dependencies += dependency('libavdevice', static: static)
endif
if usb_support
- dependencies += dependency('libusb-1.0')
+ dependencies += dependency('libusb-1.0', static: static)
endif
if host_machine.system() == 'windows'
diff --git a/meson_options.txt b/meson_options.txt
index 76075b3a..fd347734 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -2,6 +2,7 @@ option('compile_app', type: 'boolean', value: true, description: 'Build the clie
option('compile_server', type: 'boolean', value: true, description: 'Build the server')
option('prebuilt_server', type: 'string', description: 'Path of the prebuilt server')
option('portable', type: 'boolean', value: false, description: 'Use scrcpy-server from the same directory as the scrcpy executable')
+option('static', type: 'boolean', value: false, description: 'Use static dependencies')
option('server_debugger', type: 'boolean', value: false, description: 'Run a server debugger and wait for a client to be attached')
option('v4l2', type: 'boolean', value: true, description: 'Enable V4L2 feature when supported')
option('usb', type: 'boolean', value: true, description: 'Enable HID/OTG features when supported')