aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-02-16 00:08:06 +0200
committerGitHub <noreply@github.com>2018-02-16 00:08:06 +0200
commitd2445a15a1e3bc54af3737ff85ad6c37667c538e (patch)
treee4ba908b64086a67824be6917ad6bdb2bbc4b0a7 /mesonbuild/backend/backends.py
parent2c18e4eb25425d01d7315daf326a1bfd57577169 (diff)
parentb11035693c4d10b233cac0a0afaac923592b1053 (diff)
downloadmeson-d2445a15a1e3bc54af3737ff85ad6c37667c538e.zip
meson-d2445a15a1e3bc54af3737ff85ad6c37667c538e.tar.gz
meson-d2445a15a1e3bc54af3737ff85ad6c37667c538e.tar.bz2
Merge pull request #3069 from dcbaker/pch_one_arg
Fix targets with C and C++ code that use pre compiled headers
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 29c3168..62cc756 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -410,16 +410,10 @@ class Backend:
args = []
pchpath = self.get_target_private_dir(target)
includeargs = compiler.get_include_args(pchpath, False)
- for lang in ['c', 'cpp']:
- p = target.get_pch(lang)
- if not p:
- continue
- if compiler.can_compile(p[-1]):
- header = p[0]
- args += compiler.get_pch_use_args(pchpath, header)
- if len(args) > 0:
- args = includeargs + args
- return args
+ p = target.get_pch(compiler.get_language())
+ if p:
+ args += compiler.get_pch_use_args(pchpath, p[0])
+ return includeargs + args
@staticmethod
def escape_extra_args(compiler, args):