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

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


> On 09/09/2014 10:19 AM, Bach, Pascal wrote:
> > Wouldn't it make sense to use the same variables in the VS10+ Generator
> too?
> > It seems redundant to have the same information again. What's the reason
> it is hardcoded?
> 
> That's just the way it was written.  The rule variables like
> CMAKE_${lang}_CREATE_SHARED_LIBRARY contain command lines in
> which the Makefile and Ninja generators substitute for some
> placeholders.  The VS generators do not have a command line
> because they just put the declarative information into the
> project file and let VS build the command line.

I don't understand the purpose of the flag tables [1]. Aren't they there to map from command line to XML files?
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).

But it might be that this doesn't work because multi configuration or something else.

[1] https://github.com/Kitware/CMake/blob/6ae98ee18f6c35b93556a66dc0ce909d84aec18b/Source/cmVS10LinkFlagTable.h
> 
> If you want to refactor things to create more independent
> flag-holding variables that are used to construct
> CMAKE_${lang}_CREATE_SHARED_LIBRARY and also read by the
> VS generators and sent through the flag map, that's fine
> with me.  Please also update the VS 7-9 generators to use
> the same information variables if possible.

If I refactor I would change it to the way described above.

Pascal



More information about the cmake-developers mailing list