diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-11-23 23:16:46 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-12-11 14:54:30 +0530 |
commit | 70f39ee21ee632d1e23b8c3cdcd11817818b9495 (patch) | |
tree | 00d0b936f3ab989f0e9f5291f730a1756b07de60 /mesonbuild/backend/ninjabackend.py | |
parent | 04c1909a4dcc4f92c845eabab5515419f0881dc5 (diff) | |
download | meson-70f39ee21ee632d1e23b8c3cdcd11817818b9495.zip meson-70f39ee21ee632d1e23b8c3cdcd11817818b9495.tar.gz meson-70f39ee21ee632d1e23b8c3cdcd11817818b9495.tar.bz2 |
unity builds: Assembly and LLVM IR are incompatible
Can't just #include them and use them directly in unity builds. Inline
assembly is a thing, but it's not trivial and is deprecated with some
compilers. Just build them separately and link them in. Ideally the user
would then use LTO to ensure the same result.
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 188823a..b002656 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -257,10 +257,14 @@ int dummy; # Languages that can mix with C or C++ but don't support unity builds yet # because the syntax we use for unity builds is specific to C/++/ObjC/++. + # Assembly files cannot be unitified and neither can LLVM IR files langs_cant_unity = ('d', 'fortran') def get_target_source_can_unity(self, target, source): if isinstance(source, File): source = source.fname + if self.environment.is_llvm_ir(source) or \ + self.environment.is_assembly(source): + return False suffix = os.path.splitext(source)[1][1:] for lang in self.langs_cant_unity: if not lang in target.compilers: |