Skip to content

Commit 179c664

Browse files
committed
Add static build option
Use static dependencies if the option is set. PR #5515 <#5515>
1 parent 3609362 commit 179c664

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

app/meson.build

+9-7
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,22 @@ endif
109109

110110
cc = meson.get_compiler('c')
111111

112+
static = get_option('static')
113+
112114
dependencies = [
113-
dependency('libavformat', version: '>= 57.33'),
114-
dependency('libavcodec', version: '>= 57.37'),
115-
dependency('libavutil'),
116-
dependency('libswresample'),
117-
dependency('sdl2', version: '>= 2.0.5'),
115+
dependency('libavformat', version: '>= 57.33', static: static),
116+
dependency('libavcodec', version: '>= 57.37', static: static),
117+
dependency('libavutil', static: static),
118+
dependency('libswresample', static: static),
119+
dependency('sdl2', version: '>= 2.0.5', static: static),
118120
]
119121

120122
if v4l2_support
121-
dependencies += dependency('libavdevice')
123+
dependencies += dependency('libavdevice', static: static)
122124
endif
123125

124126
if usb_support
125-
dependencies += dependency('libusb-1.0')
127+
dependencies += dependency('libusb-1.0', static: static)
126128
endif
127129

128130
if host_machine.system() == 'windows'

meson_options.txt

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ option('compile_app', type: 'boolean', value: true, description: 'Build the clie
22
option('compile_server', type: 'boolean', value: true, description: 'Build the server')
33
option('prebuilt_server', type: 'string', description: 'Path of the prebuilt server')
44
option('portable', type: 'boolean', value: false, description: 'Use scrcpy-server from the same directory as the scrcpy executable')
5+
option('static', type: 'boolean', value: false, description: 'Use static dependencies')
56
option('server_debugger', type: 'boolean', value: false, description: 'Run a server debugger and wait for a client to be attached')
67
option('v4l2', type: 'boolean', value: true, description: 'Enable V4L2 feature when supported')
78
option('usb', type: 'boolean', value: true, description: 'Enable HID/OTG features when supported')

0 commit comments

Comments
 (0)