aboutsummaryrefslogtreecommitdiffhomepage
path: root/meson.build
diff options
context:
space:
mode:
authorAsh Walker <[email protected]>2022-08-12 11:20:26 -0400
committerAsh Walker <[email protected]>2022-08-12 11:21:19 -0400
commit38056c0102e4d92edee1cfbd17e1dea62e3757e9 (patch)
treeb9cba6802c44799f7827e5ad49f757f7e1c60e70 /meson.build
parentdb35a1c6d0eaa6088a5e05dca83da1a21221678d (diff)
downloadHyprland-38056c0102e4d92edee1cfbd17e1dea62e3757e9.tar.gz
Hyprland-38056c0102e4d92edee1cfbd17e1dea62e3757e9.zip
fix: support clang in meson build
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build20
1 files changed, 17 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index 7f0773ee..94353336 100644
--- a/meson.build
+++ b/meson.build
@@ -1,8 +1,22 @@
project('Hyprland', 'cpp', 'c',
version : '0.10.0beta',
- default_options : ['warning_level=2', 'default_library=static', 'optimization=3'])
-
-add_global_arguments('-std=c++23', language: 'cpp')
+ default_options : [
+ 'warning_level=2',
+ 'default_library=static',
+ 'optimization=3',
+ # 'cpp_std=c++23' # not yet supported by meson, as of version 0.63.0
+ ])
+
+# clang v14.0.6 uses C++2b instead of C++23, so we've gotta account for that
+# replace the following with a project default option once meson gets support for C++23
+cpp_compiler = meson.get_compiler('cpp')
+if cpp_compiler.has_argument('-std=c++23')
+ add_global_arguments('-std=c++23', language: 'cpp')
+elif cpp_compiler.has_argument('-std=c++2b')
+ add_global_arguments('-std=c++2b', language: 'cpp')
+else
+ error('Could not configure current C++ compiler (' + cpp_compiler.get_id() + ' ' + cpp_compiler.get_version() + ') with required C++ standard (C++23)')
+endif
GIT_BRANCH = run_command('git', 'rev-parse', '--abbrev-ref', 'HEAD', check: false).stdout().strip()
GIT_COMMIT_HASH = run_command('git', 'rev-parse', 'HEAD', check: false).stdout().strip()