summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2019-01-18 15:39:07 -0500
committerLibravatar GitHub <noreply@github.com>2019-01-18 15:39:07 -0500
commit639b66b6769722b5decc8f7a21dd7c5037f3c65c (patch)
treecd93e26b01fe51b76b124b334057011c81974859 /meson.build
parentMerge pull request #3460 from emersion/output-enable-segfault (diff)
parentmeson: remove extraneous parentheses (diff)
downloadsway-639b66b6769722b5decc8f7a21dd7c5037f3c65c.tar.gz
sway-639b66b6769722b5decc8f7a21dd7c5037f3c65c.tar.zst
sway-639b66b6769722b5decc8f7a21dd7c5037f3c65c.zip
Merge pull request #3452 from emersion/meson-features
Use Meson feature options
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build42
1 files changed, 17 insertions, 25 deletions
diff --git a/meson.build b/meson.build
index 2285cbdf..bb1c4ddf 100644
--- a/meson.build
+++ b/meson.build
@@ -2,6 +2,7 @@ project(
2 'sway', 2 'sway',
3 'c', 3 'c',
4 license: 'MIT', 4 license: 'MIT',
5 meson_version: '>=0.48.0',
5 default_options: [ 6 default_options: [
6 'c_std=c11', 7 'c_std=c11',
7 'warning_level=2', 8 'warning_level=2',
@@ -45,37 +46,39 @@ xkbcommon = dependency('xkbcommon')
45cairo = dependency('cairo') 46cairo = dependency('cairo')
46pango = dependency('pango') 47pango = dependency('pango')
47pangocairo = dependency('pangocairo') 48pangocairo = dependency('pangocairo')
48gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: false) 49gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf'))
49pixman = dependency('pixman-1') 50pixman = dependency('pixman-1')
50libevdev = dependency('libevdev') 51libevdev = dependency('libevdev')
51libinput = dependency('libinput', version: '>=1.6.0') 52libinput = dependency('libinput', version: '>=1.6.0')
52libpam = cc.find_library('pam', required: false)
53crypt = cc.find_library('crypt', required: false)
54systemd = dependency('libsystemd', required: false) 53systemd = dependency('libsystemd', required: false)
55elogind = dependency('libelogind', required: false) 54elogind = dependency('libelogind', required: false)
55xcb = dependency('xcb', required: get_option('xwayland'))
56math = cc.find_library('m') 56math = cc.find_library('m')
57rt = cc.find_library('rt') 57rt = cc.find_library('rt')
58git = find_program('git', required: false) 58git = find_program('git', required: false)
59 59
60conf_data = configuration_data() 60have_xwayland = xcb.found()
61 61
62conf_data.set10('HAVE_XWAYLAND', get_option('enable-xwayland')) 62tray_deps_found = systemd.found() or elogind.found()
63if get_option('enable-xwayland') 63if get_option('tray').enabled() and not tray_deps_found
64 xcb = dependency('xcb') 64 error('Building with -Dtray=enabled, but libsystemd and libelogind have not been not found')
65endif 65endif
66have_tray = (not get_option('tray').disabled()) and tray_deps_found
67
68conf_data = configuration_data()
66 69
70conf_data.set10('HAVE_XWAYLAND', have_xwayland)
67conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found()) 71conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found())
68conf_data.set10('HAVE_SYSTEMD', systemd.found()) 72conf_data.set10('HAVE_SYSTEMD', systemd.found())
69conf_data.set10('HAVE_ELOGIND', elogind.found()) 73conf_data.set10('HAVE_ELOGIND', elogind.found())
70conf_data.set10('HAVE_TRAY', get_option('enable-tray') and (systemd.found() or elogind.found())) 74conf_data.set10('HAVE_TRAY', have_tray)
71 75
72if not systemd.found() and not elogind.found() 76if not systemd.found() and not elogind.found()
73 warning('The sway binary must be setuid when compiled without (e)logind') 77 warning('The sway binary must be setuid when compiled without (e)logind')
74 warning('You must do this manually post-install: chmod a+s /path/to/sway') 78 warning('You must do this manually post-install: chmod a+s /path/to/sway')
75endif 79endif
76 80
77scdoc = find_program('scdoc', required: false) 81scdoc = find_program('scdoc', required: get_option('man-pages'))
78
79if scdoc.found() 82if scdoc.found()
80 sh = find_program('sh') 83 sh = find_program('sh')
81 mandir = get_option('mandir') 84 mandir = get_option('mandir')
@@ -123,17 +126,6 @@ else
123endif 126endif
124add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c') 127add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c')
125 128
126if get_option('use_rpath')
127 if get_option('custom_rpath') == ''
128 # default to platform specific libdir, one level up from the binary
129 rpathdir = join_paths('$ORIGIN', '..', '$LIB')
130 else
131 rpathdir = get_option('custom_rpath')
132 endif
133else
134 rpathdir = ''
135endif
136
137sway_inc = include_directories('include') 129sway_inc = include_directories('include')
138 130
139subdir('include') 131subdir('include')
@@ -180,7 +172,7 @@ install_data(
180 install_dir: datadir + '/wayland-sessions' 172 install_dir: datadir + '/wayland-sessions'
181) 173)
182 174
183if (get_option('default-wallpaper')) 175if get_option('default-wallpaper')
184 wallpaper_files = files( 176 wallpaper_files = files(
185 'assets/Sway_Wallpaper_Blue_768x1024.png', 177 'assets/Sway_Wallpaper_Blue_768x1024.png',
186 'assets/Sway_Wallpaper_Blue_768x1024_Portrait.png', 178 'assets/Sway_Wallpaper_Blue_768x1024_Portrait.png',
@@ -196,7 +188,7 @@ if (get_option('default-wallpaper'))
196 install_data(wallpaper_files, install_dir: wallpaper_install_dir) 188 install_data(wallpaper_files, install_dir: wallpaper_install_dir)
197endif 189endif
198 190
199if (get_option('zsh-completions')) 191if get_option('zsh-completions')
200 zsh_files = files( 192 zsh_files = files(
201 'completions/zsh/_sway', 193 'completions/zsh/_sway',
202 'completions/zsh/_swaymsg', 194 'completions/zsh/_swaymsg',
@@ -206,7 +198,7 @@ if (get_option('zsh-completions'))
206 install_data(zsh_files, install_dir: zsh_install_dir) 198 install_data(zsh_files, install_dir: zsh_install_dir)
207endif 199endif
208 200
209if (get_option('bash-completions')) 201if get_option('bash-completions')
210 bash_files = files( 202 bash_files = files(
211 'completions/bash/sway', 203 'completions/bash/sway',
212 'completions/bash/swaybar', 204 'completions/bash/swaybar',
@@ -217,7 +209,7 @@ if (get_option('bash-completions'))
217 install_data(bash_files, install_dir: bash_install_dir) 209 install_data(bash_files, install_dir: bash_install_dir)
218endif 210endif
219 211
220if (get_option('fish-completions')) 212if get_option('fish-completions')
221 fish_files = files( 213 fish_files = files(
222 'completions/fish/sway.fish', 214 'completions/fish/sway.fish',
223 'completions/fish/swaymsg.fish', 215 'completions/fish/swaymsg.fish',