[cmake-developers] confusing documentation: VS_WINRT_EXTENSIONS

Daniel Pfeifer daniel at pfeifer-mail.de
Mon Sep 2 11:42:13 EDT 2013


Hi,

The target property VS_WINRT_EXTENSIONS is documented as: "Can be set
to enable C++/CX language extensions."
Is that really what this property does?

I am trying to build a C++ project (no C++/CX) for ARM with Visual Studio 2012.

----

As an example, I took the following code:
http://msdn.microsoft.com/en-us/library/hh973459
Building on the command line in a Visual Studio prompt works fine:

> cl.exe wrl-test.cpp runtimeobject.lib

Note that the /ZW switch is not required, because no WinRT language
extensions are used!

----

Next, I tried to build it in the VS2012 ARM CrossTools Command Prompt.
Calling cl.exe like above yields the following error:

C:\Program Files (x86)\Microsoft Visual Studio
11.0\VC\INCLUDE\crtdefs.h(338) : fatal error C1189:
#error :  Compiling Desktop applications for the ARM platform is not supported.

Setting the api family to "app" solves this:

> cl.exe -DWINAPI_FAMILY=WINAPI_PARTITION_APP wrl-test.cpp runtimeobject.lib

Note again, that /ZW is not used.

----

Next, I wanted to compile the project with cmake. Using the "Visual
Studio 11" generator, it works.
Using the "Visual Studio 11 ARM" generator, CMake fails to determine
the compiler ID.
The file CompilerIdCXX.log contains the familiar message: Compiling
Desktop applications for the ARM platform is not supported.

I guess the api family needs to be set to "app" here too.

----

So my question again: Does VS_WINRT_EXTENSIONS really enable C++/CX? I hope not.

cheers, Daniel



More information about the cmake-developers mailing list