Skip to content
This repository has been archived by the owner on Dec 27, 2019. It is now read-only.

Commit

Permalink
mirage from cmake to meson
Browse files Browse the repository at this point in the history
complete migrate from cmake to meson

some minor identation tweaks

remove headers from source list

replace add_global_arguments() with add_project_arguments()

fix issues TingPing suggests

# This is a combination of 5 commits.
# This is the 1st commit message:
mirage from cmake to meson

# This is the commit message #2:

complete migrate from cmake to meson

# This is the commit message albfan#3:

some minor identation tweaks

# This is the commit message albfan#4:

remove headers from source list

# This is the commit message albfan#5:

replace add_global_arguments() with add_project_arguments()
  • Loading branch information
derekdai committed Apr 3, 2017
1 parent 3369a17 commit 4e7d022
Show file tree
Hide file tree
Showing 39 changed files with 330 additions and 771 deletions.
57 changes: 0 additions & 57 deletions CMakeLists.txt

This file was deleted.

29 changes: 0 additions & 29 deletions cmake/FindReadline.cmake

This file was deleted.

8 changes: 0 additions & 8 deletions config.h.cmake

This file was deleted.

8 changes: 8 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef CONFIG_H
#define CONFIG_H

#define BUILD_BINDIR "@BUILD_BINDIR@"

#define PACKAGE_STRING "@PACKAGE_STRING@"

#endif // CONFIG_H
66 changes: 0 additions & 66 deletions demo/CMakeLists.txt

This file was deleted.

24 changes: 24 additions & 0 deletions demo/meson.build
Original file line number Diff line number Diff line change
@@ -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
)
6 changes: 0 additions & 6 deletions demo/res/wfdctl-res.xml

This file was deleted.

11 changes: 0 additions & 11 deletions demo/res/wfdctl.ui

This file was deleted.

4 changes: 2 additions & 2 deletions demo/wfdctl.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
53 changes: 53 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
project('Miraclecast',
'c',
version: '1',
meson_version: '>=0.39',
default_options: ['buildtype=debugoptimized', 'c_std=gnu11']
)

glib2 = dependency('glib-2.0')
udev = dependency('libudev')
libsystemd = dependency('libsystemd')
gstreamer = dependency('gstreamer-1.0')
gstreamer_base = dependency('gstreamer-base-1.0')

if get_option('build-enable-debug')
add_project_arguments('-DBUILD_ENABLE_DEBUG', language: 'c')
endif

c_compiler = meson.get_compiler('c')
if c_compiler.has_argument('-std=gnu11')
add_project_arguments('-std=gnu11', language: 'c')
endif

readline = c_compiler.find_library('readline', required: false)
if readline.found()
add_project_arguments('-DHAVE_READLINE', language: 'c')
endif

add_project_arguments('-D_GNU_SOURCE', language: 'c')

r = c_compiler.compiles('''int main() { return _Generic(0, int: 0); }''',
name: 'C11 generic selection')
if false == r
error('C11 generic selection is required')
endif

subdir('src')
subdir('res')
subdir('test')

if get_option('build-demo')
subdir('demo')
endif

conf_data = configuration_data()
conf_data.set('BUILD_BINDIR',
'"' + join_paths(get_option('prefix'), get_option('bindir')) + '"'
)
conf_data.set('PACKAGE_STRING',
'"@0@ @1@"'.format(meson.project_name(),
meson.project_version()))
configure_file(output: 'config.h',
configuration: conf_data
)
16 changes: 16 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
option('build-enable-debug',
type: 'boolean',
value: true,
description: 'Enable Debug')
option('rely-udev',
type: 'boolean',
value: false,
description: 'Rely in udev tag to select device')
option('build-tests',
type: 'boolean',
value: true,
description: 'Enable TEST')
option('build-demo',
type: 'boolean',
value: false,
description: 'Enable DEMO')
65 changes: 0 additions & 65 deletions res/CMakeLists.txt

This file was deleted.

6 changes: 6 additions & 0 deletions res/create-symlinks
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
SYSTEMD_SYSTEM_UNIT_DIR=${DESTDIR}`pkg-config --variable=systemdsystemunitdir systemd`
ln -sfv miracle-wifid.service \
${SYSTEMD_SYSTEM_UNIT_DIR}/dbos-org.freedesktop.miracle.wifi.service
ln -sfv miracle-dispd.service \
${SYSTEMD_SYSTEM_UNIT_DIR}/dbos-org.freedesktop.miracle.wfd.service
8 changes: 8 additions & 0 deletions res/install-scripts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
RESDIR="${MESON_SOURCE_ROOT}/res"
BINDIR="${MESON_INSTALL_DESTDIR_PREFIX}/$1"

install -dv "$BINDIR"
install -v "$RESDIR"/miracle-gst "$BINDIR"
install -v "$RESDIR"/gstplayer "$BINDIR"
install -v "$RESDIR"/uibc-viewer "$BINDIR"
Loading

0 comments on commit 4e7d022

Please sign in to comment.