summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build25
1 files changed, 21 insertions, 4 deletions
diff --git a/meson.build b/meson.build
index 253a4e96..1e7ce281 100644
--- a/meson.build
+++ b/meson.build
@@ -22,6 +22,10 @@ datadir = get_option('datadir')
22sysconfdir = get_option('sysconfdir') 22sysconfdir = get_option('sysconfdir')
23prefix = get_option('prefix') 23prefix = get_option('prefix')
24 24
25if is_freebsd
26 add_project_arguments('-D_C11_SOURCE', language: 'c')
27endif
28
25swayidle_deps = [] 29swayidle_deps = []
26 30
27jsonc = dependency('json-c', version: '>=0.13') 31jsonc = dependency('json-c', version: '>=0.13')
@@ -38,9 +42,8 @@ pango = dependency('pango')
38pangocairo = dependency('pangocairo') 42pangocairo = dependency('pangocairo')
39gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: false) 43gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: false)
40pixman = dependency('pixman-1') 44pixman = dependency('pixman-1')
41libcap = dependency('libcap', required: false)
42libinput = dependency('libinput', version: '>=1.6.0') 45libinput = dependency('libinput', version: '>=1.6.0')
43libpam = cc.find_library('pam') 46libpam = cc.find_library('pam', required: false)
44systemd = dependency('libsystemd', required: false) 47systemd = dependency('libsystemd', required: false)
45elogind = dependency('libelogind', required: false) 48elogind = dependency('libelogind', required: false)
46math = cc.find_library('m') 49math = cc.find_library('m')
@@ -70,6 +73,11 @@ if elogind.found()
70 swayidle_deps += elogind 73 swayidle_deps += elogind
71endif 74endif
72 75
76if not systemd.found() and not elogind.found()
77 warning('The sway binary must be setuid when compiled without (e)logind')
78 warning('You must do this manually post-install: chmod a+s /path/to/sway')
79endif
80
73scdoc = find_program('scdoc', required: false) 81scdoc = find_program('scdoc', required: false)
74 82
75if scdoc.found() 83if scdoc.found()
@@ -120,7 +128,16 @@ else
120endif 128endif
121add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c') 129add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c')
122 130
123add_project_arguments('-D_LD_LIBRARY_PATH="@0@"'.format(get_option('ld-library-path')), language: 'c') 131if get_option('use_rpath')
132 if get_option('custom_rpath') == ''
133 # default to platform specific libdir, one level up from the binary
134 rpathdir = join_paths('$ORIGIN', '..', '$LIB')
135 else
136 rpathdir = get_option('custom_rpath')
137 endif
138else
139 rpathdir = ''
140endif
124 141
125sway_inc = include_directories('include') 142sway_inc = include_directories('include')
126 143
@@ -133,9 +150,9 @@ subdir('swaymsg')
133subdir('client') 150subdir('client')
134subdir('swaybg') 151subdir('swaybg')
135subdir('swaybar') 152subdir('swaybar')
136subdir('swaylock')
137subdir('swayidle') 153subdir('swayidle')
138subdir('swaynag') 154subdir('swaynag')
155subdir('swaylock')
139 156
140config = configuration_data() 157config = configuration_data()
141config.set('sysconfdir', join_paths(prefix, sysconfdir)) 158config.set('sysconfdir', join_paths(prefix, sysconfdir))