mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
add meson build supporting
This commit is contained in:
parent
9acad15b72
commit
7dba31c923
20 changed files with 336 additions and 8 deletions
|
@ -11,14 +11,10 @@ execute_process(COMMAND ${VALAC} --version
|
|||
OUTPUT_VARIABLE VALAC_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string(REPLACE "Vala " "" VALAC_VERSION "${VALAC_VERSION}")
|
||||
if(VALAC_VERSION VERSION_GREATER 0.34.0)
|
||||
list(APPEND VALA_EXTRA_OPTIONS -D VALA_VERSION_NEWER_THEN_0_34)
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --atleast-version 3.22 gdk-3.0
|
||||
RESULT_VARIABLE GDK_VERSION_NEWER_THEN_3_22)
|
||||
if(NOT GDK_VERSION_NEWER_THEN_3_22)
|
||||
list(APPEND VALA_EXTRA_OPTIONS -D GDK_VERSION_NEWER_THEN_3_22)
|
||||
if(VALAC_VERSION VERSION_GREATER 0.34.0 AND NOT GDK_VERSION_NEWER_THEN_3_22)
|
||||
list(APPEND VALA_EXTRA_OPTIONS -D GDK3_HAS_MONITOR_CLASS)
|
||||
endif()
|
||||
|
||||
set(DBUS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dbus)
|
||||
|
|
24
demo/meson.build
Normal file
24
demo/meson.build
Normal file
|
@ -0,0 +1,24 @@
|
|||
add_languages('vala')
|
||||
|
||||
gio2 = dependency('gio-2.0')
|
||||
gdk3 = dependency('gdk-3.0')
|
||||
|
||||
valac = meson.get_compiler('vala')
|
||||
valac_extra_args = []
|
||||
if valac.version().version_compare('>=0.34') and gdk3.version().version_compare('>=3.22')
|
||||
valac_extra_args += ['-D', 'GDK3_HAS_MONITOR_CLASS']
|
||||
endif
|
||||
|
||||
miracle_wfdctl_src = ['wfdctl.vala',
|
||||
'sigint.vapi',
|
||||
'sigint.c',
|
||||
'org-freedesktop-networkmanager.vala',
|
||||
'org-freedesktop-miracle-wifi.vala',
|
||||
'org-freedesktop-miracle-wfd.vala'
|
||||
]
|
||||
|
||||
executable('miracle-wfdctl', miracle_wfdctl_src,
|
||||
dependencies: [gio2, gdk3],
|
||||
vala_args: valac_extra_args,
|
||||
install: true
|
||||
)
|
|
@ -400,7 +400,7 @@ private class WfdCtl : GLib.Application
|
|||
info("P2P group formed");
|
||||
}
|
||||
|
||||
#if GDK_VERSION_NEWER_THEN_3_22 && VALA_VERSION_NEWER_THEN_0_34
|
||||
#if GDK3_HAS_MONITOR_CLASS
|
||||
private void get_monitor_geometry(out Gdk.Rectangle g) throws Error
|
||||
{
|
||||
Gdk.Monitor m;
|
||||
|
@ -623,7 +623,7 @@ private class WfdCtl : GLib.Application
|
|||
}
|
||||
|
||||
int n_monitors;
|
||||
#if GDK_VERSION_NEWER_THEN_3_22 && VALA_VERSION_NEWER_THEN_0_34
|
||||
#if GDK3_HAS_MONITOR_CLASS
|
||||
n_monitors = display.get_n_monitors();
|
||||
#else
|
||||
n_monitors = display.get_default_screen().get_n_monitors();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue