[cmake-developers] [PATCH 3/3] VS: Pass MSVC compiler flags in upper case

Bach, Pascal pascal.bach at siemens.com
Tue Sep 9 11:52:38 EDT 2014


> > At first I tought the way things work was:
> > Windows-MSVC.cmake and Co construct a commandline with the required
> flags.
> > The VS generator parses this command line and uses the cmVS7FlagTable
> to
> > translate the known flags to XML elements.
> > (Unknown arguments get passed as additional arguments).
> 
> This is done for a subset of the sources of flags, specifically
> those settable by users and project code.  We can't use a complete
> command line like that in CMAKE_${lang}_CREATE_SHARED_LIBRARY
> because that will contain a lot of pieces besides the flags.
> Also multi-configuration is an issue as you point out.
> 
> You would need to create new variables in Windows-MSVC to hold
> the flags to be scanned by the VS generators.  Then re-use the
> flags in constructing the other rule variables with command-lines
> used by the Makefile and Ninja generators.

Looks like a bigger refactoring would be needed.
Maybe for the moment it is better to implement it analogous to WindowsPhone
and then later refactor the whole thing.

Pascal




More information about the cmake-developers mailing list