From c1fa61b7d9361d563e22b48974b55a188b7e9d70 Mon Sep 17 00:00:00 2001 From: Nicolas Schneider Date: Sun, 3 Feb 2019 19:38:20 +0100 Subject: [PATCH] vs: add PCH headers to project Otherwise, they will not be visible in the IDE. --- mesonbuild/backend/vs2010backend.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index 783ae64cf..621aa1a4d 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -1153,7 +1153,7 @@ class Vs2010Backend(backends.Backend): ET.SubElement(meson_file_group, 'None', Include=os.path.join(proj_to_src_dir, build_filename)) extra_files = target.extra_files - if len(headers) + len(gen_hdrs) + len(extra_files) > 0: + if len(headers) + len(gen_hdrs) + len(extra_files) + len(pch_sources) > 0: inc_hdrs = ET.SubElement(root, 'ItemGroup') for h in headers: relpath = os.path.join(down, h.rel_to_builddir(self.build_to_src)) @@ -1163,6 +1163,9 @@ class Vs2010Backend(backends.Backend): for h in target.extra_files: relpath = os.path.join(down, h.rel_to_builddir(self.build_to_src)) ET.SubElement(inc_hdrs, 'CLInclude', Include=relpath) + for lang in pch_sources: + h = pch_sources[lang][0] + ET.SubElement(inc_hdrs, 'CLInclude', Include=os.path.join(proj_to_src_dir, h)) if len(sources) + len(gen_src) + len(pch_sources) > 0: inc_src = ET.SubElement(root, 'ItemGroup')