If a Windows resource (.rc) source file is included in a STATIC library,
the VS "link" tool will process the compiled ".res" file and needs to know
the target architecture. Without it, we may get a LNK4068 warning and
possibly a LNK1112 error. Add /machine: to the default static library
flags to give the link tool the information it needs.
Changes in commit b9aa5041 (cmLocalGenerator: Simplify GetIncludeFlags
output formatting, 2014-03-04) caused Windows Resource Compiler include
directories to be computed as relative paths in the Ninja generator.
This breaks the cmcldeps handling of include paths. The reason for the
regression is that several cmLocalGenerator::GetIncludeFlags callers
treated the fourth "bool forResponseFile" argument as if it controlled
whether include directories were a full path. It actually did control
that by accident until the above commit.
Add an explicit "bool forceFullPaths" argument to GetIncludeFlags
and thread the value through ConvertToIncludeReference as needed.
Update GetIncludeFlags call sites that really wanted to control the
forResponseFile setting to be aware of the new argument. Extend the
VSResource test to cover this case.
Thanks to Pau Garcia i Quiles for the inspiration for the patch.
I've tweaked it a bit compared to what's in the bug tracker: this
commit does not allow empty global variable names.
I also added usage of the new feature to an existing test. Although
it has no effect on the resulting Visual Studio projects, you can
verify that the VSResource test produces a non-empty globals section
in the generated .vcproj(x) files.
To get rc defines to work in the VS10 IDE requires \" when
constructing PreprocessorDefinitions strings. This is different
than defines for cl.
Also, per-file rc defines were not being generated. Fix that, too.