aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorQyriad <qyriad@qyriad.me>2024-06-06 22:21:52 +0000
committerGerrit Code Review <gerrit@lix-systems>2024-06-06 22:21:52 +0000
commitec768df0046659e75974919f5923661a29ff52c9 (patch)
tree569c3b5a3158ae66d288059c8b8d9f6f271825da /meson.build
parent1659404626b80509db162fddcc1f5294fe590afa (diff)
parent766e718f6739e9098d18674bd71cb0f4bc5bbf43 (diff)
Merge changes Ic4be41eb,I48db2385 into main
* changes: devshells: only enable pch for clang build: expose option to enable or disable precompiled std headers
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build14
1 files changed, 14 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index b98b1fb15..7fd29bdf5 100644
--- a/meson.build
+++ b/meson.build
@@ -129,6 +129,20 @@ endif
cxx = meson.get_compiler('cpp')
+
+# clangd breaks when GCC is using precompiled headers lmao
+# https://git.lix.systems/lix-project/lix/issues/374
+should_pch = get_option('enable-pch-std')
+summary('PCH C++ stdlib', should_pch, bool_yn : true)
+if should_pch
+ # Unlike basically everything else that takes a file, Meson requires the arguments to
+ # cpp_pch : to be strings and doesn't accept files(). So absolute path it is.
+ cpp_pch = [meson.project_source_root() / 'src/pch/precompiled-headers.hh']
+else
+ cpp_pch = []
+endif
+
+
# Translate some historical and Mesony CPU names to Lixy CPU names.
# FIXME(Qyriad): the 32-bit x86 code is not tested right now, because cross compilation for Lix
# to those architectures is currently broken for other reasons, namely: