Hard-coded PCH name in WinRT XAML

孤人 提交于 2019-12-11 04:55:48

问题


WinRT project, C++/CX. When my XAML files are compiled, the generated code files contain an

#include "pch.h"

line. I want my precompiler header to be called differently - stdafx.h, for legacy code reasons. Changing it in project properties affects C++ sources, but not the XAML compiler - it still emits the pch.h line. I could not find XAML compiler settings anywhere in the project properties.

How do I change the PCH name that XAML compiler assumes, please?


回答1:


The name of the precompiled headers file is not configurable in the XAML compiler in Visual Studio 2012. It is assumed to be pch.h, which is the default name of the file in all of the project templates.

It might be possible to tweak the build targets files to disable use of precompiled headers for XAML-generated C++ source files; I'm not that familiar with the targets, so I cannot say for sure. Alternatively, you could disable usage of precompiled headers for your project, then enable usage per-file for all of the non-generated C++ source files in the project.

If this feature is important to you, please consider opening an issue on Microsoft Connect.



来源:https://stackoverflow.com/questions/11209467/hard-coded-pch-name-in-winrt-xaml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!