diff options
author | Brad King <brad.king@kitware.com> | 2009-04-24 15:18:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-04-24 15:18:06 (GMT) |
commit | 708d1cf1ee9300bc9b9e26a47e1bbe1718612d6f (patch) | |
tree | da8134e5e88176619d7ffc29ec010a9035540d5e /Source/cmLocalGenerator.cxx | |
parent | 70b2f59c3f9c70c085966bacb1e8a41c3ad2947f (diff) | |
download | CMake-708d1cf1ee9300bc9b9e26a47e1bbe1718612d6f.zip CMake-708d1cf1ee9300bc9b9e26a47e1bbe1718612d6f.tar.gz CMake-708d1cf1ee9300bc9b9e26a47e1bbe1718612d6f.tar.bz2 |
ENH: Support more preprocessor values in VS6
Previously we rejected all preprocessor definition values containing
spaces for the VS6 IDE generator. In fact VS6 does support spaces but
not in combination with '"', '$', or ';', and only if we use the sytnax
'-DNAME="value with spaces"' instead of '-D"NAME=value with spaces"'.
Now we support all definition values that do not have one of these
invalid pairs. See issue #8779.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index c38bedd..f66988e 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1994,8 +1994,15 @@ void cmLocalGenerator::AppendDefines(std::string& defines, } else { - // Make the definition appear properly on the command line. - defines += this->EscapeForShell(di->c_str(), true); + // Make the definition appear properly on the command line. Use + // -DNAME="value" instead of -D"NAME=value" to help VS6 parser. + std::string::size_type eq = di->find("="); + defines += di->substr(0, eq); + if(eq != di->npos) + { + defines += "="; + defines += this->EscapeForShell(di->c_str() + eq + 1, true); + } } } } |