From 06e65e537bd0570aa9de3cc8bad3a1ca006b38b8 Mon Sep 17 00:00:00 2001 From: Qyriad Date: Thu, 6 Jun 2024 12:46:26 -0600 Subject: 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 --- meson.build | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'meson.build') 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: -- cgit v1.2.3