diff options
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/meson.build b/meson.build index c602d008..71e75fd9 100644 --- a/meson.build +++ b/meson.build | |||
@@ -3,7 +3,7 @@ project( | |||
3 | 'c', | 3 | 'c', |
4 | version: '1.10-dev', | 4 | version: '1.10-dev', |
5 | license: 'MIT', | 5 | license: 'MIT', |
6 | meson_version: '>=0.60.0', | 6 | meson_version: '>=1.3', |
7 | default_options: [ | 7 | default_options: [ |
8 | 'c_std=c11', | 8 | 'c_std=c11', |
9 | 'warning_level=2', | 9 | 'warning_level=2', |
@@ -38,14 +38,14 @@ if is_freebsd | |||
38 | endif | 38 | endif |
39 | 39 | ||
40 | # Execute the wlroots subproject, if any | 40 | # Execute the wlroots subproject, if any |
41 | wlroots_version = ['>=0.18.0', '<0.19.0'] | 41 | wlroots_version = ['>=0.19.0', '<0.20.0'] |
42 | subproject( | 42 | subproject( |
43 | 'wlroots', | 43 | 'wlroots', |
44 | default_options: ['examples=false'], | 44 | default_options: ['examples=false'], |
45 | required: false, | 45 | required: false, |
46 | version: wlroots_version, | 46 | version: wlroots_version, |
47 | ) | 47 | ) |
48 | wlroots = dependency('wlroots-0.18', version: wlroots_version, fallback: 'wlroots') | 48 | wlroots = dependency('wlroots-0.19', version: wlroots_version, fallback: 'wlroots') |
49 | wlroots_features = { | 49 | wlroots_features = { |
50 | 'xwayland': false, | 50 | 'xwayland': false, |
51 | 'libinput_backend': false, | 51 | 'libinput_backend': false, |
@@ -160,8 +160,8 @@ add_project_arguments('-DSYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir | |||
160 | version = '"@0@"'.format(meson.project_version()) | 160 | version = '"@0@"'.format(meson.project_version()) |
161 | git = find_program('git', native: true, required: false) | 161 | git = find_program('git', native: true, required: false) |
162 | if git.found() | 162 | if git.found() |
163 | git_commit = run_command([git, 'rev-parse', '--short', 'HEAD'], check: false) | 163 | git_commit = run_command([git, '--git-dir=.git', 'rev-parse', '--short', 'HEAD'], check: false) |
164 | git_branch = run_command([git, 'rev-parse', '--abbrev-ref', 'HEAD'], check: false) | 164 | git_branch = run_command([git, '--git-dir=.git', 'rev-parse', '--abbrev-ref', 'HEAD'], check: false) |
165 | if git_commit.returncode() == 0 and git_branch.returncode() == 0 | 165 | if git_commit.returncode() == 0 and git_branch.returncode() == 0 |
166 | version = '"@0@-@1@ (" __DATE__ ", branch \'@2@\')"'.format( | 166 | version = '"@0@-@1@ (" __DATE__ ", branch \'@2@\')"'.format( |
167 | meson.project_version(), | 167 | meson.project_version(), |
@@ -172,31 +172,10 @@ if git.found() | |||
172 | endif | 172 | endif |
173 | add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c') | 173 | add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c') |
174 | 174 | ||
175 | # Compute the relative path used by compiler invocations. | 175 | fs = import('fs') |
176 | source_root = meson.current_source_dir().split('/') | ||
177 | build_root = meson.global_build_root().split('/') | ||
178 | relative_dir_parts = [] | ||
179 | i = 0 | ||
180 | in_prefix = true | ||
181 | foreach p : build_root | ||
182 | if i >= source_root.length() or not in_prefix or p != source_root[i] | ||
183 | in_prefix = false | ||
184 | relative_dir_parts += '..' | ||
185 | endif | ||
186 | i += 1 | ||
187 | endforeach | ||
188 | i = 0 | ||
189 | in_prefix = true | ||
190 | foreach p : source_root | ||
191 | if i >= build_root.length() or not in_prefix or build_root[i] != p | ||
192 | in_prefix = false | ||
193 | relative_dir_parts += p | ||
194 | endif | ||
195 | i += 1 | ||
196 | endforeach | ||
197 | relative_dir = join_paths(relative_dir_parts) + '/' | ||
198 | 176 | ||
199 | # Strip relative path prefixes from the code if possible, otherwise hide them. | 177 | # Strip relative path prefixes from the code if possible, otherwise hide them. |
178 | relative_dir = fs.relative_to(meson.current_source_dir(), meson.global_build_root()) + '/' | ||
200 | if cc.has_argument('-fmacro-prefix-map=/prefix/to/hide=') | 179 | if cc.has_argument('-fmacro-prefix-map=/prefix/to/hide=') |
201 | add_project_arguments( | 180 | add_project_arguments( |
202 | '-fmacro-prefix-map=@0@='.format(relative_dir), | 181 | '-fmacro-prefix-map=@0@='.format(relative_dir), |