[CMake] Double quotes being removed Windows removing compiler flags
Andreas Mohr
andi at lisas.de
Thu Jul 12 07:03:28 EDT 2012
Hi,
On Thu, Jul 12, 2012 at 08:20:50AM +0200, François Best wrote:
> I was able to fix my problem by adding the replacement of "\\\"" (escaped
> quote) before the actual replacement of the non-escaped quote in the
> generator.
>
> Here is the patch:
>
> diff --git a/Source/cmVisualStudioGeneratorOptions.cxx
> b/Source/cmVisualStudioGeneratorOptions.cxx
> index 9369af6..5371d0f 100644
> --- a/Source/cmVisualStudioGeneratorOptions.cxx
> +++ b/Source/cmVisualStudioGeneratorOptions.cxx
> @@ -16,6 +16,7 @@ inline std::string
> cmVisualStudioGeneratorOptionsEscapeForXML(const char* s)
> {
> std::string ret = s;
> cmSystemTools::ReplaceString(ret, "&", "&");
> + cmSystemTools::ReplaceString(ret, "\\\"", """);
> cmSystemTools::ReplaceString(ret, "\"", """);
> cmSystemTools::ReplaceString(ret, "<", "<");
> cmSystemTools::ReplaceString(ret, ">", ">");
Perhaps a comment that order of replacements is crucial would be useful.
I'm a bit concerned about this mapping.
After all we're mapping *two* different symbols (\\\", \")
to one *identical* result only ("),
IOW we are producing "information loss",
i.e. a loss in expression variety, at this stage/layer of information
transmission
(relevance here: if someone else passed input of \\\",
expecting it to end up as a veritable "backslash", "quote" combination
- since he did *NOT* pass \" only -
then he'll be in for a rough awakening).
(probably see communication / encoding theory, sending information
over a series of various transmission channels,
and then obviously strongly attempting to end up with the same set
of fully qualified data payload at the sink side
as was put in at the source side).
So perhaps it's the prior layer which is broken
and thus should do things differently
(i.e., avoid passing a backslash-escaped unit despite only intending
for it to end up as quote-only, which the
cmVisualStudioGeneratorOptionsEscapeForXML() conversion handling
already accounted for but obviously did not match in this case!).
> Best,
>
> François Best
> Hardware & Software Engineer
Better? :)
Andreas Mohr
More information about the CMake
mailing list