[cmake-developers] [CMake 0011880]: For Visual Studio 2010, adding /Y- (don't use precompiled headers) to a source file's properties does not remove the /Yu flag

Mantis Bug Tracker mantis at public.kitware.com
Fri Feb 18 13:22:42 EST 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=11880 
====================================================================== 
Reported By:                Brad Town
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   11880
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   low
Status:                     new
====================================================================== 
Date Submitted:             2011-02-18 13:22 EST
Last Modified:              2011-02-18 13:22 EST
====================================================================== 
Summary:                    For Visual Studio 2010, adding /Y- (don't use
precompiled headers) to a source file's properties does not remove the /Yu flag
Description: 
Adding the /Y- flag (don't use precompiled headers) does not remove the /Yu flag
(use precompiled headers), so when viewed in Visual Studio, such a file appears
to still use precompiled headers. However, the command line shows that /Y- is
added and overrides /Yu.

Steps to Reproduce: 
Consider the following:

--- cut here ---
if (MSVC)
    set_target_properties(FooProj PROPERTIES COMPILE_FLAGS "/YuFoo.h")
    set_source_files_properties(Foo.cpp PROPERTIES COMPILE_FLAGS "/YcFoo.h")
    set_source_files_properties(FooNotUsingPch.cpp PROPERTIES COMPILE_FLAGS
"/Y-")
endif ()
--- cut here ---

Adding the /Y- flag does not remove the /Yu flag, so when viewed in Visual
Studio, FooNotUsingPch.cpp appears to still use precompiled headers. However,
the command line shows that /Y- is added and overrides it.

Additional Information: 
This only appears to affect how the project appears in the IDE.

/Y- is not listed in cmVS10CLFlagTable.h like /Yc and /Yu are. The option for
"Not Using Precompiled Headers" is "", which in this case may not be sufficient.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-02-18 13:22 Brad Town      New Issue                                    
======================================================================




More information about the cmake-developers mailing list