Comments (4)
This is actually a bug in Clang. It has been reported upstream here:
http://llvm.org/bugs/show_bug.cgi?id=15136
from meson.
Oh!
I've created quick and dirty workaround for clang:
diff --git a/environment.py b/environment.py
index 1cf26ca..9e1a90e 100644
--- a/environment.py
+++ b/environment.py
@@ -1099,6 +1099,9 @@ class ClangCCompiler(CCompiler):
def can_compile(self, filename):
return super().can_compile(filename) or filename.split('.')[-1] == 's' # Clang can do asm, too.
+ def get_pch_use_args(self, pch_dir, header):
+ return ['-include-pch', os.path.join (pch_dir, self.get_pch_name (header))]
+
class GnuCPPCompiler(CPPCompiler):
std_warn_args = ['-Wall', '-Winvalid-pch']
# may need to separate the latter to extra_debug_args or something
@@ -1149,6 +1152,9 @@ class ClangCPPCompiler(CPPCompiler):
def get_pch_suffix(self):
return 'pch'
+ def get_pch_use_args(self, pch_dir, header):
+ return ['-include-pch', os.path.join (pch_dir, self.get_pch_name (header))]
+
class FortranCompiler():
std_warn_args = ['-Wall']
from meson.
Thanks for this. Unfortunately -include-pch is not a Clang frontend flag bug a backend one. Those are unfortunately not guaranteed to be stable. This patch does solve a real problem, though. I'll need to think about this for a bit.
In the mean time you can disable the use of precompiled headers either by passing --disable-pch to Meson when you first set up your project or with 'mesonconf -Dpch=false' afterwards. This allows you to use pch on setups that work and disable them for Clang.
from meson.
This is now in trunk. Hopefully clang devs will fix the include bug before changing -include-pch.
Thanks.
from meson.
Related Issues (20)
- Vulkan detection fails on msys build HOT 2
- Finding Qt6 in Cross-Compilation Setup HOT 2
- bug: pulseaudio cannot be built as a souce from apt on ubuntu 24.04 HOT 1
- compiler.has_argument() does not support gcc -Wno-attributes=
- Vala C code started printing warnings on 1.4.0 HOT 4
- [Feature Request]: Add built-in option(s) to simplify hardening binaries HOT 5
- Dlang: D compilers can also consume *.i files as sources
- compiler.get_define result is incorrectly cached
- Unity builds should allow excluding files from units HOT 5
- Compiling a project with SDL2 using SDL2 repo instead of wrapdb
- Linker detection uses compiler binary even when <lang>_ld flag option is specified
- Custom manifest does not work with VS backend HOT 3
- /home/MesonBuild/meson: not found during Generating symbol file HOT 2
- Feature request: initialize env object from another env HOT 3
- Relative rpaths are used for a pkgconfig dependency on Linux HOT 1
- additional options to wx-config for wxwidgets dependency HOT 1
- cmake `check_c_source_compiles` fails while finding deps when `c` binary is a list of strings HOT 6
- Meson does not correctly handle `ifx` when linking to an external library HOT 2
- Unknown method "name" in object <[ExternalLibraryHolder] holds [ExternalLibrary]: <ExternalL ibrary m: True>> of type ExternalLibraryHolder HOT 1
- CosmoCC compiler components not detected as executable HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meson.