diff options
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 42 |
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') | |||
45 | cairo = dependency('cairo') | 46 | cairo = dependency('cairo') |
46 | pango = dependency('pango') | 47 | pango = dependency('pango') |
47 | pangocairo = dependency('pangocairo') | 48 | pangocairo = dependency('pangocairo') |
48 | gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: false) | 49 | gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf')) |
49 | pixman = dependency('pixman-1') | 50 | pixman = dependency('pixman-1') |
50 | libevdev = dependency('libevdev') | 51 | libevdev = dependency('libevdev') |
51 | libinput = dependency('libinput', version: '>=1.6.0') | 52 | libinput = dependency('libinput', version: '>=1.6.0') |
52 | libpam = cc.find_library('pam', required: false) | ||
53 | crypt = cc.find_library('crypt', required: false) | ||
54 | systemd = dependency('libsystemd', required: false) | 53 | systemd = dependency('libsystemd', required: false) |
55 | elogind = dependency('libelogind', required: false) | 54 | elogind = dependency('libelogind', required: false) |
55 | xcb = dependency('xcb', required: get_option('xwayland')) | ||
56 | math = cc.find_library('m') | 56 | math = cc.find_library('m') |
57 | rt = cc.find_library('rt') | 57 | rt = cc.find_library('rt') |
58 | git = find_program('git', required: false) | 58 | git = find_program('git', required: false) |
59 | 59 | ||
60 | conf_data = configuration_data() | 60 | have_xwayland = xcb.found() |
61 | 61 | ||
62 | conf_data.set10('HAVE_XWAYLAND', get_option('enable-xwayland')) | 62 | tray_deps_found = systemd.found() or elogind.found() |
63 | if get_option('enable-xwayland') | 63 | if 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') |
65 | endif | 65 | endif |
66 | have_tray = (not get_option('tray').disabled()) and tray_deps_found | ||
67 | |||
68 | conf_data = configuration_data() | ||
66 | 69 | ||
70 | conf_data.set10('HAVE_XWAYLAND', have_xwayland) | ||
67 | conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found()) | 71 | conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found()) |
68 | conf_data.set10('HAVE_SYSTEMD', systemd.found()) | 72 | conf_data.set10('HAVE_SYSTEMD', systemd.found()) |
69 | conf_data.set10('HAVE_ELOGIND', elogind.found()) | 73 | conf_data.set10('HAVE_ELOGIND', elogind.found()) |
70 | conf_data.set10('HAVE_TRAY', get_option('enable-tray') and (systemd.found() or elogind.found())) | 74 | conf_data.set10('HAVE_TRAY', have_tray) |
71 | 75 | ||
72 | if not systemd.found() and not elogind.found() | 76 | if 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') |
75 | endif | 79 | endif |
76 | 80 | ||
77 | scdoc = find_program('scdoc', required: false) | 81 | scdoc = find_program('scdoc', required: get_option('man-pages')) |
78 | |||
79 | if scdoc.found() | 82 | if 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 | |||
123 | endif | 126 | endif |
124 | add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c') | 127 | add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c') |
125 | 128 | ||
126 | if 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 | ||
133 | else | ||
134 | rpathdir = '' | ||
135 | endif | ||
136 | |||
137 | sway_inc = include_directories('include') | 129 | sway_inc = include_directories('include') |
138 | 130 | ||
139 | subdir('include') | 131 | subdir('include') |
@@ -180,7 +172,7 @@ install_data( | |||
180 | install_dir: datadir + '/wayland-sessions' | 172 | install_dir: datadir + '/wayland-sessions' |
181 | ) | 173 | ) |
182 | 174 | ||
183 | if (get_option('default-wallpaper')) | 175 | if 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) |
197 | endif | 189 | endif |
198 | 190 | ||
199 | if (get_option('zsh-completions')) | 191 | if 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) |
207 | endif | 199 | endif |
208 | 200 | ||
209 | if (get_option('bash-completions')) | 201 | if 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) |
218 | endif | 210 | endif |
219 | 211 | ||
220 | if (get_option('fish-completions')) | 212 | if 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', |