View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015100CMakeCCMakepublic2014-08-21 16:062015-03-02 08:57
ReporterTimur 
Assigned ToBrad King 
PriorityhighSeveritytweakReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 3.0.1 
Target VersionCMake 3.1Fixed in VersionCMake 3.1 
Summary0015100: /ZW- compiler flag to disable CompileAsWinRT property in Visual Studio project
DescriptionRelated to Issue 0012930

Visual Studio 12 WinRT application project requires CompileAsWinRT enabled
But when project also contains .c files this option must be turned off on them.
C files cannot be compiled with CompileAsWinRT setting.

CompileAsWinRT can be enabled with compile flag /ZW but cannot be disabled with /ZW-

Can be easily fixed by addition additional compile flag definition for /ZW- before /ZW:

  {"CompileAsWinRT", "ZW-", "", "false", 0},
before existing: {"CompileAsWinRT", "ZW", "", "true", 0},

into the cmVS12CLFlagTable[] and cmVS11CLFlagTable
Additional Information---
 Source/cmVS11CLFlagTable.h | 1 +
 Source/cmVS12CLFlagTable.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/Source/cmVS11CLFlagTable.h b/Source/cmVS11CLFlagTable.h
index a61ab16..f591309 100644
--- a/Source/cmVS11CLFlagTable.h
+++ b/Source/cmVS11CLFlagTable.h
@@ -163,6 +163,7 @@ static cmVS7FlagTable cmVS11CLFlagTable[] =
 
 
   //Bool Properties
+ {"CompileAsWinRT", "ZW-", "", "false", 0},
   {"CompileAsWinRT", "ZW", "", "true", 0},
   {"WinRTNoStdLib", "ZW:nostdlib", "", "true", 0},
   {"SuppressStartupBanner", "nologo-", "", "false", 0},
diff --git a/Source/cmVS12CLFlagTable.h b/Source/cmVS12CLFlagTable.h
index 0a7916f..348f75b 100644
--- a/Source/cmVS12CLFlagTable.h
+++ b/Source/cmVS12CLFlagTable.h
@@ -172,6 +172,7 @@ static cmVS7FlagTable cmVS12CLFlagTable[] =
 
 
   //Bool Properties
+ {"CompileAsWinRT", "ZW-", "", "false", 0},
   {"CompileAsWinRT", "ZW", "", "true", 0},
   {"WinRTNoStdLib", "ZW:nostdlib", "", "true", 0},
   {"SuppressStartupBanner", "nologo", "", "true", 0},
--
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0036664)
Brad King (manager)
2014-08-22 09:40
edited on: 2014-09-02 10:18

AFAICT there is no "/ZW-" flag defined by cl, so it is not appropriate to add that to the flag table. Instead the VS generator should simply be taught to disable CompileAsWinRT for C sources when the rest of the target has it:

 VS: Do not compile C sources as WinRT
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd11ae8f [^]

There happens to be ongoing development right now to support Windows Phone and Store applications. There is a new VS_WINRT_COMPONENT target property to mark a shared library as a Windows Runtime component.

(0036666)
Timur (reporter)
2014-08-22 09:59

Yes indeed unfortunately Microsoft did not provided /ZW- option.

Indeed I first implemented it as a patch to VS generator, but though that with flag table it would be cleaner.
(0038102)
Robert Maynard (manager)
2015-03-02 08:57

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2014-08-21 16:06 Timur New Issue
2014-08-22 09:40 Brad King Note Added: 0036664
2014-08-22 09:59 Timur Note Added: 0036666
2014-09-02 10:18 Brad King Note Edited: 0036664
2014-09-02 10:18 Brad King Assigned To => Brad King
2014-09-02 10:18 Brad King Status new => resolved
2014-09-02 10:18 Brad King Resolution open => fixed
2014-09-02 10:18 Brad King Fixed in Version => CMake 3.1
2014-09-02 10:18 Brad King Target Version => CMake 3.1
2015-03-02 08:57 Robert Maynard Note Added: 0038102
2015-03-02 08:57 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team