diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2013-12-05 05:17:24 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-12-09 15:29:43 (GMT) |
commit | 0b9906c2fba3fa7d2aebc5e217da31cd129b2bfc (patch) | |
tree | 512d1177b107bba94ddd7b016530f0c6a140b531 /Source/cmcldeps.cxx | |
parent | ce598cc838c717132a122a97c5e21b99f11fe23b (diff) | |
download | CMake-0b9906c2fba3fa7d2aebc5e217da31cd129b2bfc.zip CMake-0b9906c2fba3fa7d2aebc5e217da31cd129b2bfc.tar.gz CMake-0b9906c2fba3fa7d2aebc5e217da31cd129b2bfc.tar.bz2 |
Windows: Use wide-character system APIs
Make CMake compile with -DUNICODE. Make it possible for the 8 bit
encoding to eventually be UTF-8 instead ANSI.
Diffstat (limited to 'Source/cmcldeps.cxx')
-rw-r--r-- | Source/cmcldeps.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/cmcldeps.cxx b/Source/cmcldeps.cxx index 8571557..0675470 100644 --- a/Source/cmcldeps.cxx +++ b/Source/cmcldeps.cxx @@ -23,6 +23,7 @@ #include <windows.h> #include <sstream> #include <cmSystemTools.h> +#include <cmsys/Encoding.hxx> // We don't want any wildcard expansion. // See http://msdn.microsoft.com/en-us/library/zay8tzh6(v=vs.85).aspx @@ -100,7 +101,7 @@ static std::string getArg(std::string& cmdline) { return ret; } -static void parseCommandLine(LPTSTR wincmdline, +static void parseCommandLine(LPWSTR wincmdline, std::string& lang, std::string& srcfile, std::string& dfile, @@ -109,7 +110,7 @@ static void parseCommandLine(LPTSTR wincmdline, std::string& clpath, std::string& binpath, std::string& rest) { - std::string cmdline(wincmdline); + std::string cmdline = cmsys::Encoding::ToNarrow(wincmdline); /* self */ getArg(cmdline); lang = getArg(cmdline); srcfile = getArg(cmdline); @@ -247,7 +248,7 @@ int main() { // the same command line verbatim. std::string lang, srcfile, dfile, objfile, prefix, cl, binpath, rest; - parseCommandLine(GetCommandLine(), lang, srcfile, dfile, objfile, + parseCommandLine(GetCommandLineW(), lang, srcfile, dfile, objfile, prefix, cl, binpath, rest); // needed to suppress filename output of msvc tools |