summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cpack.cxx2
-rw-r--r--Source/CTest/cmProcess.cxx2
-rw-r--r--Source/cmExecuteProcessCommand.cxx11
-rw-r--r--Source/cmMakefileTargetGenerator.cxx7
-rw-r--r--Source/cmNinjaTargetGenerator.cxx7
-rw-r--r--Source/cmProcessOutput.cxx15
-rw-r--r--Source/cmProcessOutput.h7
-rw-r--r--Source/cmServerProtocol.cxx2
-rw-r--r--Source/cmVS140CLFlagTable.h2
-rw-r--r--Source/cmVS141CLFlagTable.h1
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx8
-rw-r--r--Source/cmakemain.cxx2
-rw-r--r--Source/ctest.cxx2
14 files changed, 66 insertions, 4 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index e26e402..d5f5724 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 7)
-set(CMake_VERSION_PATCH 20161201)
+set(CMake_VERSION_PATCH 20161202)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index fa526ae..af80cbf 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -91,7 +91,9 @@ int main(int argc, char const* const* argv)
#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
// Replace streambuf so we can output Unicode to console
cmsys::ConsoleBuf::Manager consoleOut(std::cout);
+ consoleOut.SetUTF8Pipes();
cmsys::ConsoleBuf::Manager consoleErr(std::cerr, true);
+ consoleErr.SetUTF8Pipes();
#endif
cmsys::Encoding::CommandLineArguments args =
cmsys::Encoding::CommandLineArguments::Main(argc, argv);
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index 98bd3bb..32ffa6b 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -105,7 +105,7 @@ bool cmProcess::Buffer::GetLast(std::string& line)
int cmProcess::GetNextOutputLine(std::string& line, double timeout)
{
- cmProcessOutput processOutput;
+ cmProcessOutput processOutput(cmProcessOutput::UTF8);
std::string strdata;
for (;;) {
// Look for lines already buffered.
diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx
index 1562223..eb26a50 100644
--- a/Source/cmExecuteProcessCommand.cxx
+++ b/Source/cmExecuteProcessCommand.cxx
@@ -47,6 +47,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
std::string error_variable;
std::string result_variable;
std::string working_directory;
+ cmProcessOutput::Encoding encoding = cmProcessOutput::Auto;
for (size_t i = 0; i < args.size(); ++i) {
if (args[i] == "COMMAND") {
doing_command = true;
@@ -128,6 +129,14 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
} else if (args[i] == "ERROR_STRIP_TRAILING_WHITESPACE") {
doing_command = false;
error_strip_trailing_whitespace = true;
+ } else if (args[i] == "ENCODING") {
+ doing_command = false;
+ if (++i < args.size()) {
+ encoding = cmProcessOutput::FindEncoding(args[i]);
+ } else {
+ this->SetError(" called with no value for ENCODING.");
+ return false;
+ }
} else if (doing_command) {
cmds[command_index].push_back(args[i].c_str());
} else {
@@ -223,7 +232,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
int length;
char* data;
int p;
- cmProcessOutput processOutput;
+ cmProcessOutput processOutput(encoding);
std::string strdata;
while ((p = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR), p)) {
// Put the output in the right place.
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 2e5173d..6906a90 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -520,8 +520,15 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
targetFullPathCompilePDB =
this->GeneratorTarget->GetCompilePDBPath(this->ConfigName);
if (targetFullPathCompilePDB.empty()) {
+ // Match VS default: `$(IntDir)vc$(PlatformToolsetVersion).pdb`.
+ // A trailing slash tells the toolchain to add its default file name.
targetFullPathCompilePDB =
this->GeneratorTarget->GetSupportDirectory() + "/";
+ if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) {
+ // Match VS default for static libs: `$(IntDir)$(ProjectName).pdb`.
+ targetFullPathCompilePDB += this->GeneratorTarget->GetName();
+ targetFullPathCompilePDB += ".pdb";
+ }
}
}
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index e47de97..8090542 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -359,7 +359,14 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
compilePdbPath =
this->GeneratorTarget->GetCompilePDBPath(this->GetConfigName());
if (compilePdbPath.empty()) {
+ // Match VS default: `$(IntDir)vc$(PlatformToolsetVersion).pdb`.
+ // A trailing slash tells the toolchain to add its default file name.
compilePdbPath = this->GeneratorTarget->GetSupportDirectory() + "/";
+ if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) {
+ // Match VS default for static libs: `$(IntDir)$(ProjectName).pdb`.
+ compilePdbPath += this->GeneratorTarget->GetName();
+ compilePdbPath += ".pdb";
+ }
}
}
diff --git a/Source/cmProcessOutput.cxx b/Source/cmProcessOutput.cxx
index 1440223..8b4d0e1 100644
--- a/Source/cmProcessOutput.cxx
+++ b/Source/cmProcessOutput.cxx
@@ -9,6 +9,21 @@ unsigned int cmProcessOutput::defaultCodepage =
KWSYS_ENCODING_DEFAULT_CODEPAGE;
#endif
+cmProcessOutput::Encoding cmProcessOutput::FindEncoding(std::string name)
+{
+ Encoding encoding = Auto;
+ if (name == "UTF8") {
+ encoding = UTF8;
+ } else if (name == "NONE") {
+ encoding = None;
+ } else if (name == "ANSI") {
+ encoding = ANSI;
+ } else if (name == "OEM") {
+ encoding = OEM;
+ }
+ return encoding;
+}
+
cmProcessOutput::cmProcessOutput(Encoding encoding, unsigned int maxSize)
{
#if defined(_WIN32)
diff --git a/Source/cmProcessOutput.h b/Source/cmProcessOutput.h
index 6a4e7d5..6046f57 100644
--- a/Source/cmProcessOutput.h
+++ b/Source/cmProcessOutput.h
@@ -27,6 +27,13 @@ public:
OEM
};
+ /**
+ * Find encoding enum value for given encoding \a name.
+ * \param name a encoding name.
+ * \return encoding enum value or Auto if \a name was not found.
+ */
+ static Encoding FindEncoding(std::string name);
+
/// The code page that is used as internal encoding to which we will encode.
static unsigned int defaultCodepage;
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index 9a06f05..3776538 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -936,7 +936,7 @@ cmServerResponse cmServerProtocol1_0::ProcessConfigure(
}
// Make sure the types of cacheArguments matches (if given):
- std::vector<std::string> cacheArgs;
+ std::vector<std::string> cacheArgs = { "unused" };
bool cacheArgumentsError = false;
const Json::Value passedArgs = request.Data[kCACHE_ARGUMENTS_KEY];
if (!passedArgs.isNull()) {
diff --git a/Source/cmVS140CLFlagTable.h b/Source/cmVS140CLFlagTable.h
index 317cc18..60b4379 100644
--- a/Source/cmVS140CLFlagTable.h
+++ b/Source/cmVS140CLFlagTable.h
@@ -164,6 +164,8 @@ static cmVS7FlagTable cmVS140CLFlagTable[] = {
{ "TreatWChar_tAsBuiltInType", "Zc:wchar_t", "", "true", 0 },
{ "ForceConformanceInForLoopScope", "Zc:forScope-", "", "false", 0 },
{ "ForceConformanceInForLoopScope", "Zc:forScope", "", "true", 0 },
+ { "RemoveUnreferencedCodeData", "Zc:inline-", "", "false", 0 },
+ { "RemoveUnreferencedCodeData", "Zc:inline", "", "true", 0 },
{ "RuntimeTypeInfo", "GR-", "", "false", 0 },
{ "RuntimeTypeInfo", "GR", "", "true", 0 },
{ "OpenMPSupport", "openmp-", "", "false", 0 },
diff --git a/Source/cmVS141CLFlagTable.h b/Source/cmVS141CLFlagTable.h
index 895b3e8..f751fc8 100644
--- a/Source/cmVS141CLFlagTable.h
+++ b/Source/cmVS141CLFlagTable.h
@@ -171,6 +171,7 @@ static cmVS7FlagTable cmVS141CLFlagTable[] = {
{ "TreatWChar_tAsBuiltInType", "Zc:wchar_t", "", "true", 0 },
{ "ForceConformanceInForLoopScope", "Zc:forScope-", "", "false", 0 },
{ "ForceConformanceInForLoopScope", "Zc:forScope", "", "true", 0 },
+ { "RemoveUnreferencedCodeData", "Zc:inline-", "", "false", 0 },
{ "RemoveUnreferencedCodeData", "Zc:inline", "", "true", 0 },
{ "EnforceTypeConversionRules", "Zc:rvalueCast-", "", "false", 0 },
{ "EnforceTypeConversionRules", "Zc:rvalueCast", "", "true", 0 },
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 22c3024..8ab3b04 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1593,6 +1593,14 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
*this->BuildFileStream << cmVS10EscapeXML(intermediateDir)
<< "</IntDir>\n";
+ if (const char* workingDir = this->GeneratorTarget->GetProperty(
+ "VS_DEBUGGER_WORKING_DIRECTORY")) {
+ this->WritePlatformConfigTag("LocalDebuggerWorkingDirectory",
+ config->c_str(), 3);
+ *this->BuildFileStream << cmVS10EscapeXML(workingDir)
+ << "</LocalDebuggerWorkingDirectory>\n";
+ }
+
std::string name =
cmSystemTools::GetFilenameWithoutLastExtension(targetNameFull);
this->WritePlatformConfigTag("TargetName", config->c_str(), 3);
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index dee288c..b8e227f 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -160,7 +160,9 @@ int main(int ac, char const* const* av)
#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
// Replace streambuf so we can output Unicode to console
cmsys::ConsoleBuf::Manager consoleOut(std::cout);
+ consoleOut.SetUTF8Pipes();
cmsys::ConsoleBuf::Manager consoleErr(std::cerr, true);
+ consoleErr.SetUTF8Pipes();
#endif
cmsys::Encoding::CommandLineArguments args =
cmsys::Encoding::CommandLineArguments::Main(ac, av);
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index 1acd240..1cf75c8 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -116,7 +116,9 @@ int main(int argc, char const* const* argv)
#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
// Replace streambuf so we can output Unicode to console
cmsys::ConsoleBuf::Manager consoleOut(std::cout);
+ consoleOut.SetUTF8Pipes();
cmsys::ConsoleBuf::Manager consoleErr(std::cerr, true);
+ consoleErr.SetUTF8Pipes();
#endif
cmsys::Encoding::CommandLineArguments encoding_args =
cmsys::Encoding::CommandLineArguments::Main(argc, argv);