Improve crossbuild configuration

Use meson native features to detect crossbuild, and remove the
user-provided option crossbuild_windows.
This commit is contained in:
Romain Vimont 2021-12-10 19:50:58 +01:00
parent 892cfe943e
commit 0685c491cd
3 changed files with 3 additions and 4 deletions

View File

@ -82,7 +82,9 @@ endif
cc = meson.get_compiler('c')
if not get_option('crossbuild_windows')
crossbuild_windows = meson.is_cross_build() and host_machine.system() == 'windows'
if not crossbuild_windows
# native build
dependencies = [

View File

@ -1,6 +1,5 @@
option('compile_app', type: 'boolean', value: true, description: 'Build the client')
option('compile_server', type: 'boolean', value: true, description: 'Build the server')
option('crossbuild_windows', type: 'boolean', value: false, description: 'Build for Windows from Linux')
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('server_debugger', type: 'boolean', value: false, description: 'Run a server debugger and wait for a client to be attached')

View File

@ -70,7 +70,6 @@ build-win32: prepare-deps-win32
meson "$(WIN32_BUILD_DIR)" \
--cross-file cross_win32.txt \
--buildtype release --strip -Db_lto=true \
-Dcrossbuild_windows=true \
-Dcompile_server=false \
-Dportable=true )
ninja -C "$(WIN32_BUILD_DIR)"
@ -83,7 +82,6 @@ build-win64: prepare-deps-win64
meson "$(WIN64_BUILD_DIR)" \
--cross-file cross_win64.txt \
--buildtype release --strip -Db_lto=true \
-Dcrossbuild_windows=true \
-Dcompile_server=false \
-Dportable=true )
ninja -C "$(WIN64_BUILD_DIR)"