aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorQyriad <qyriad@qyriad.me>2024-06-06 12:46:26 -0600
committerQyriad <qyriad@qyriad.me>2024-06-06 12:46:26 -0600
commit06e65e537bd0570aa9de3cc8bad3a1ca006b38b8 (patch)
treef5d8300f7acb71e96e4f1acd95a0166ec9acdf5a /meson.build
parent8f9bcd20ebc1a4bdf44e8c1b16cac9a905c505d9 (diff)
build: expose option to enable or disable precompiled std headers
They are enabled by default, and Meson will also prints whether or not they're enabled at the bottom at the end of configuration. Change-Id: I48db238510bf9e74340b86f243f4bbe360794281
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: