summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersion.cmake6
-rw-r--r--Source/QtIFW/cmake.org.html2
-rw-r--r--Source/cmExportBuildAndroidMKGenerator.cxx12
-rw-r--r--Source/cmExtraCodeLiteGenerator.cxx4
-rw-r--r--Source/cmFileMonitor.cxx8
-rw-r--r--Source/cmGlobalGenerator.cxx19
-rw-r--r--Source/cmGlobalGenerator.h4
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx4
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx4
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx10
-rw-r--r--Source/cmNinjaTargetGenerator.cxx2
-rw-r--r--Source/cmServerConnection.cxx162
-rw-r--r--Source/cmServerConnection.h15
-rw-r--r--Source/cmVS140CLFlagTable.h237
-rw-r--r--Source/cmVS141CLFlagTable.h (renamed from Source/cmVS14CLFlagTable.h)2
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx17
-rw-r--r--Source/cmake.cxx2
-rw-r--r--Source/kwsys/SystemTools.cxx20
18 files changed, 444 insertions, 86 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 51a0fff..6cb0fea 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 6)
-set(CMake_VERSION_PATCH 20161003)
-#set(CMake_VERSION_RC 1)
+set(CMake_VERSION_MINOR 7)
+set(CMake_VERSION_PATCH 0)
+set(CMake_VERSION_RC 1)
diff --git a/Source/QtIFW/cmake.org.html b/Source/QtIFW/cmake.org.html
index cf5649d..001d634 100644
--- a/Source/QtIFW/cmake.org.html
+++ b/Source/QtIFW/cmake.org.html
@@ -1,6 +1,6 @@
<html>
<head>
-<meta http-equiv="Refresh" content="0; url=http://cmake.org/" />
+<meta http-equiv="Refresh" content="0; url=https://cmake.org/" />
</head>
<body>
</body>
diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx
index bb02311..f5e6628 100644
--- a/Source/cmExportBuildAndroidMKGenerator.cxx
+++ b/Source/cmExportBuildAndroidMKGenerator.cxx
@@ -9,6 +9,8 @@
#include "cmMakefile.h"
#include "cmTargetExport.h"
+#include <algorithm>
+
cmExportBuildAndroidMKGenerator::cmExportBuildAndroidMKGenerator()
{
this->LG = CM_NULLPTR;
@@ -164,6 +166,16 @@ void cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties(
}
}
}
+
+ // Tell the NDK build system if prebuilt static libraries use C++.
+ if (target->GetType() == cmState::STATIC_LIBRARY) {
+ cmLinkImplementation const* li = target->GetLinkImplementation(config);
+ if (std::find(li->Languages.begin(), li->Languages.end(), "CXX") !=
+ li->Languages.end()) {
+ os << "LOCAL_HAS_CPP := true\n";
+ }
+ }
+
switch (target->GetType()) {
case cmState::SHARED_LIBRARY:
case cmState::MODULE_LIBRARY:
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 629c5b6..360c852 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -60,7 +60,6 @@ void cmExtraCodeLiteGenerator::Generate()
// loop projects and locate the root project.
// and extract the information for creating the worspace
// root makefile
- const cmMakefile* rmf = CM_NULLPTR;
for (std::map<std::string, std::vector<cmLocalGenerator*> >::const_iterator
it = projectMap.begin();
it != projectMap.end(); ++it) {
@@ -75,7 +74,6 @@ void cmExtraCodeLiteGenerator::Generate()
workspaceFileName = workspaceOutputDir + "/";
workspaceFileName += workspaceProjectName + ".workspace";
this->WorkspacePath = it->second[0]->GetCurrentBinaryDirectory();
- rmf = it->second[0]->GetMakefile();
;
break;
}
@@ -89,7 +87,7 @@ void cmExtraCodeLiteGenerator::Generate()
xml.Attribute("Name", workspaceProjectName);
bool const targetsAreProjects =
- rmf && rmf->IsOn("CMAKE_CODELITE_USE_TARGETS");
+ this->GlobalGenerator->GlobalSettingIsOn("CMAKE_CODELITE_USE_TARGETS");
std::vector<std::string> ProjectNames;
if (targetsAreProjects) {
diff --git a/Source/cmFileMonitor.cxx b/Source/cmFileMonitor.cxx
index b97590b..41ec8b4 100644
--- a/Source/cmFileMonitor.cxx
+++ b/Source/cmFileMonitor.cxx
@@ -12,7 +12,7 @@
namespace {
void on_directory_change(uv_fs_event_t* handle, const char* filename,
int events, int status);
-void on_handle_close(uv_handle_t* handle);
+void on_fs_close(uv_handle_t* handle);
} // namespace
class cmIBaseWatcher
@@ -177,7 +177,7 @@ public:
{
if (this->Handle) {
uv_fs_event_stop(this->Handle);
- uv_close(reinterpret_cast<uv_handle_t*>(this->Handle), &on_handle_close);
+ uv_close(reinterpret_cast<uv_handle_t*>(this->Handle), &on_fs_close);
this->Handle = nullptr;
}
cmVirtualDirectoryWatcher::StopWatching();
@@ -292,9 +292,9 @@ void on_directory_change(uv_fs_event_t* handle, const char* filename,
watcher->Trigger(pathSegment, events, status);
}
-void on_handle_close(uv_handle_t* handle)
+void on_fs_close(uv_handle_t* handle)
{
- delete (reinterpret_cast<uv_fs_event_t*>(handle));
+ delete reinterpret_cast<uv_fs_event_t*>(handle);
}
} // namespace
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index a446862..7132ade 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1007,6 +1007,25 @@ void cmGlobalGenerator::FillExtensionToLanguageMap(const std::string& l,
}
}
+const char* cmGlobalGenerator::GetGlobalSetting(std::string const& name) const
+{
+ assert(!this->Makefiles.empty());
+ return this->Makefiles[0]->GetDefinition(name);
+}
+
+bool cmGlobalGenerator::GlobalSettingIsOn(std::string const& name) const
+{
+ assert(!this->Makefiles.empty());
+ return this->Makefiles[0]->IsOn(name);
+}
+
+const char* cmGlobalGenerator::GetSafeGlobalSetting(
+ std::string const& name) const
+{
+ assert(!this->Makefiles.empty());
+ return this->Makefiles[0]->GetSafeDefinition(name);
+}
+
bool cmGlobalGenerator::IgnoreFile(const char* ext) const
{
if (!this->GetLanguageFromExtension(ext).empty()) {
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 4120b52..add2b92 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -194,6 +194,10 @@ public:
cmExportSetMap& GetExportSets() { return this->ExportSets; }
+ const char* GetGlobalSetting(std::string const& name) const;
+ bool GlobalSettingIsOn(std::string const& name) const;
+ const char* GetSafeGlobalSetting(std::string const& name) const;
+
/** Add a file to the manifest of generated targets for a configuration. */
void AddToManifest(std::string const& f);
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index cb20117..4a6990e 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -192,7 +192,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
this->LocalGenerator->AppendFlags(
linkFlags, this->Makefile->GetDefinition(export_flag_var));
}
- if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE")) {
+ if (this->GeneratorTarget->GetPropertyAsBool("LINK_WHAT_YOU_USE")) {
this->LocalGenerator->AppendFlags(linkFlags, " -Wl,--no-as-needed");
}
@@ -354,7 +354,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
vars.LinkFlags = linkFlags.c_str();
vars.Manifests = manifests.c_str();
- if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE")) {
+ if (this->GeneratorTarget->GetPropertyAsBool("LINK_WHAT_YOU_USE")) {
std::string cmakeCommand = this->LocalGenerator->ConvertToOutputFormat(
cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL);
cmakeCommand += " -E __run_iwyu --lwyu=";
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index b969bfb..2b1d7cc 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -161,7 +161,7 @@ void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
extraFlags, "CMAKE_SHARED_LINKER_FLAGS", this->ConfigName);
this->AddModuleDefinitionFlag(extraFlags);
- if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE")) {
+ if (this->GeneratorTarget->GetPropertyAsBool("LINK_WHAT_YOU_USE")) {
this->LocalGenerator->AppendFlags(extraFlags, " -Wl,--no-as-needed");
}
this->WriteLibraryRules(linkRuleVar, extraFlags, relink);
@@ -638,7 +638,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
// Get the set of commands.
std::string linkRule = this->GetLinkRule(linkRuleVar);
cmSystemTools::ExpandListArgument(linkRule, real_link_commands);
- if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE") &&
+ if (this->GeneratorTarget->GetPropertyAsBool("LINK_WHAT_YOU_USE") &&
(this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY)) {
std::string cmakeCommand = this->LocalGenerator->ConvertToOutputFormat(
cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL);
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 095c703..cd6dd1a 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -315,7 +315,7 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
const char* linkCmd = mf->GetDefinition(linkCmdVar);
if (linkCmd) {
cmSystemTools::ExpandListArgument(linkCmd, linkCmds);
- if (this->GetGeneratorTarget()->GetProperty("LINK_WHAT_YOU_USE")) {
+ if (this->GetGeneratorTarget()->GetPropertyAsBool("LINK_WHAT_YOU_USE")) {
std::string cmakeCommand =
this->GetLocalGenerator()->ConvertToOutputFormat(
cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL);
@@ -505,7 +505,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
vars["LINK_PATH"] = frameworkPath + linkPath;
std::string lwyuFlags;
- if (genTarget.GetProperty("LINK_WHAT_YOU_USE")) {
+ if (genTarget.GetPropertyAsBool("LINK_WHAT_YOU_USE")) {
lwyuFlags = " -Wl,--no-as-needed";
}
@@ -645,7 +645,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
std::string postBuildCmdLine = localGen.BuildCommandLine(postBuildCmdLines);
cmNinjaVars symlinkVars;
- if (targetOutput == targetOutputReal) {
+ bool const symlinkNeeded =
+ (targetOutput != targetOutputReal && !gt.IsFrameworkOnApple());
+ if (!symlinkNeeded) {
vars["POST_BUILD"] = postBuildCmdLine;
} else {
vars["POST_BUILD"] = ":";
@@ -687,7 +689,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
commandLineLengthLimit, &usedResponseFile);
this->WriteLinkRule(usedResponseFile);
- if (targetOutput != targetOutputReal && !gt.IsFrameworkOnApple()) {
+ if (symlinkNeeded) {
if (targetType == cmState::EXECUTABLE) {
globalGen.WriteBuild(
this->GetBuildFileStream(),
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index fb2581d..46a6161 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -427,7 +427,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
: mf->GetSafeDefinition("CMAKE_CXX_COMPILER");
cldeps = "\"";
cldeps += cmSystemTools::GetCMClDepsCommand();
- cldeps += "\" " + lang + " $in \"$DEP_FILE\" $out \"";
+ cldeps += "\" " + lang + " " + vars.Source + " \"$DEP_FILE\" $out \"";
cldeps += mf->GetSafeDefinition("CMAKE_CL_SHOWINCLUDES_PREFIX");
cldeps += "\" \"" + cl + "\" ";
}
diff --git a/Source/cmServerConnection.cxx b/Source/cmServerConnection.cxx
index c9822d3..a814d16 100644
--- a/Source/cmServerConnection.cxx
+++ b/Source/cmServerConnection.cxx
@@ -30,7 +30,7 @@ void on_read(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf)
if (nread >= 0) {
conn->ReadData(std::string(buf->base, buf->base + nread));
} else {
- conn->HandleEof();
+ conn->TriggerShutdown();
}
delete[](buf->base);
@@ -56,6 +56,28 @@ void on_new_connection(uv_stream_t* stream, int status)
conn->Connect(stream);
}
+void on_signal(uv_signal_t* signal, int signum)
+{
+ auto conn = reinterpret_cast<cmServerConnection*>(signal->data);
+ (void)(signum);
+ conn->TriggerShutdown();
+}
+
+void on_signal_close(uv_handle_t* handle)
+{
+ delete reinterpret_cast<uv_signal_t*>(handle);
+}
+
+void on_pipe_close(uv_handle_t* handle)
+{
+ delete reinterpret_cast<uv_pipe_t*>(handle);
+}
+
+void on_tty_close(uv_handle_t* handle)
+{
+ delete reinterpret_cast<uv_tty_t*>(handle);
+}
+
} // namespace
class LoopGuard
@@ -64,19 +86,25 @@ public:
LoopGuard(cmServerConnection* connection)
: Connection(connection)
{
- Connection->mLoop = uv_default_loop();
- if (Connection->mLoop) {
- Connection->mFileMonitor = new cmFileMonitor(Connection->mLoop);
+ this->Connection->mLoop = uv_default_loop();
+ if (!this->Connection->mLoop) {
+ return;
}
+ this->Connection->mFileMonitor =
+ new cmFileMonitor(this->Connection->mLoop);
}
~LoopGuard()
{
- if (Connection->mFileMonitor) {
- delete Connection->mFileMonitor;
+ if (!this->Connection->mLoop) {
+ return;
}
- uv_loop_close(Connection->mLoop);
- Connection->mLoop = nullptr;
+
+ if (this->Connection->mFileMonitor) {
+ delete this->Connection->mFileMonitor;
+ }
+ uv_loop_close(this->Connection->mLoop);
+ this->Connection->mLoop = nullptr;
}
private:
@@ -111,6 +139,16 @@ bool cmServerConnection::ProcessEvents(std::string* errorMessage)
return false;
}
+ this->SIGINTHandler = new uv_signal_t;
+ uv_signal_init(this->mLoop, this->SIGINTHandler);
+ this->SIGINTHandler->data = static_cast<void*>(this);
+ uv_signal_start(this->SIGINTHandler, &on_signal, SIGINT);
+
+ this->SIGHUPHandler = new uv_signal_t;
+ uv_signal_init(this->mLoop, this->SIGHUPHandler);
+ this->SIGHUPHandler->data = static_cast<void*>(this);
+ uv_signal_start(this->SIGHUPHandler, &on_signal, SIGHUP);
+
if (!DoSetup(errorMessage)) {
return false;
}
@@ -162,9 +200,21 @@ void cmServerConnection::ReadData(const std::string& data)
}
}
-void cmServerConnection::HandleEof()
+void cmServerConnection::TriggerShutdown()
{
this->FileMonitor()->StopMonitoring();
+
+ uv_signal_stop(this->SIGINTHandler);
+ uv_signal_stop(this->SIGHUPHandler);
+
+ uv_close(reinterpret_cast<uv_handle_t*>(this->SIGINTHandler),
+ &on_signal_close); // delete handle
+ uv_close(reinterpret_cast<uv_handle_t*>(this->SIGHUPHandler),
+ &on_signal_close); // delete handle
+
+ this->SIGINTHandler = nullptr;
+ this->SIGHUPHandler = nullptr;
+
this->TearDown();
}
@@ -194,30 +244,42 @@ void cmServerConnection::SendGreetings()
Server->PrintHello();
}
+cmServerStdIoConnection::cmServerStdIoConnection()
+{
+ this->Input.tty = nullptr;
+ this->Output.tty = nullptr;
+}
+
bool cmServerStdIoConnection::DoSetup(std::string* errorMessage)
{
(void)(errorMessage);
if (uv_guess_handle(1) == UV_TTY) {
- uv_tty_init(this->Loop(), &this->Input.tty, 0, 1);
- uv_tty_set_mode(&this->Input.tty, UV_TTY_MODE_NORMAL);
- Input.tty.data = this;
- this->ReadStream = reinterpret_cast<uv_stream_t*>(&this->Input.tty);
-
- uv_tty_init(this->Loop(), &this->Output.tty, 1, 0);
- uv_tty_set_mode(&this->Output.tty, UV_TTY_MODE_NORMAL);
- Output.tty.data = this;
- this->WriteStream = reinterpret_cast<uv_stream_t*>(&this->Output.tty);
+ usesTty = true;
+ this->Input.tty = new uv_tty_t;
+ uv_tty_init(this->Loop(), this->Input.tty, 0, 1);
+ uv_tty_set_mode(this->Input.tty, UV_TTY_MODE_NORMAL);
+ Input.tty->data = this;
+ this->ReadStream = reinterpret_cast<uv_stream_t*>(this->Input.tty);
+
+ this->Output.tty = new uv_tty_t;
+ uv_tty_init(this->Loop(), this->Output.tty, 1, 0);
+ uv_tty_set_mode(this->Output.tty, UV_TTY_MODE_NORMAL);
+ Output.tty->data = this;
+ this->WriteStream = reinterpret_cast<uv_stream_t*>(this->Output.tty);
} else {
- uv_pipe_init(this->Loop(), &this->Input.pipe, 0);
- uv_pipe_open(&this->Input.pipe, 0);
- Input.pipe.data = this;
- this->ReadStream = reinterpret_cast<uv_stream_t*>(&this->Input.pipe);
-
- uv_pipe_init(this->Loop(), &this->Output.pipe, 0);
- uv_pipe_open(&this->Output.pipe, 1);
- Output.pipe.data = this;
- this->WriteStream = reinterpret_cast<uv_stream_t*>(&this->Output.pipe);
+ usesTty = false;
+ this->Input.pipe = new uv_pipe_t;
+ uv_pipe_init(this->Loop(), this->Input.pipe, 0);
+ uv_pipe_open(this->Input.pipe, 0);
+ Input.pipe->data = this;
+ this->ReadStream = reinterpret_cast<uv_stream_t*>(this->Input.pipe);
+
+ this->Output.pipe = new uv_pipe_t;
+ uv_pipe_init(this->Loop(), this->Output.pipe, 0);
+ uv_pipe_open(this->Output.pipe, 1);
+ Output.pipe->data = this;
+ this->WriteStream = reinterpret_cast<uv_stream_t*>(this->Output.pipe);
}
SendGreetings();
@@ -228,26 +290,35 @@ bool cmServerStdIoConnection::DoSetup(std::string* errorMessage)
void cmServerStdIoConnection::TearDown()
{
- uv_close(reinterpret_cast<uv_handle_t*>(this->ReadStream), nullptr);
+ if (usesTty) {
+ uv_close(reinterpret_cast<uv_handle_t*>(this->Input.tty), &on_tty_close);
+ uv_close(reinterpret_cast<uv_handle_t*>(this->Output.tty), &on_tty_close);
+ this->Input.tty = nullptr;
+ this->Output.tty = nullptr;
+ } else {
+ uv_close(reinterpret_cast<uv_handle_t*>(this->Input.pipe), &on_pipe_close);
+ uv_close(reinterpret_cast<uv_handle_t*>(this->Output.pipe),
+ &on_pipe_close);
+ this->Input.pipe = nullptr;
+ this->Input.pipe = nullptr;
+ }
this->ReadStream = nullptr;
- uv_close(reinterpret_cast<uv_handle_t*>(this->WriteStream), nullptr);
this->WriteStream = nullptr;
}
cmServerPipeConnection::cmServerPipeConnection(const std::string& name)
: PipeName(name)
{
- this->ServerPipe.data = nullptr;
- this->ClientPipe.data = nullptr;
}
bool cmServerPipeConnection::DoSetup(std::string* errorMessage)
{
- uv_pipe_init(this->Loop(), &this->ServerPipe, 0);
- this->ServerPipe.data = this;
+ this->ServerPipe = new uv_pipe_t;
+ uv_pipe_init(this->Loop(), this->ServerPipe, 0);
+ this->ServerPipe->data = this;
int r;
- if ((r = uv_pipe_bind(&this->ServerPipe, this->PipeName.c_str())) != 0) {
+ if ((r = uv_pipe_bind(this->ServerPipe, this->PipeName.c_str())) != 0) {
*errorMessage = std::string("Internal Error with ") + this->PipeName +
": " + uv_err_name(r);
return false;
@@ -265,31 +336,34 @@ bool cmServerPipeConnection::DoSetup(std::string* errorMessage)
void cmServerPipeConnection::TearDown()
{
- if (this->WriteStream->data) {
- uv_close(reinterpret_cast<uv_handle_t*>(this->WriteStream), nullptr);
+ if (this->ClientPipe) {
+ uv_close(reinterpret_cast<uv_handle_t*>(this->ClientPipe), &on_pipe_close);
this->WriteStream->data = nullptr;
}
- uv_close(reinterpret_cast<uv_handle_t*>(&this->ServerPipe), nullptr);
+ uv_close(reinterpret_cast<uv_handle_t*>(&this->ServerPipe), &on_pipe_close);
+ this->ClientPipe = nullptr;
+ this->ServerPipe = nullptr;
this->WriteStream = nullptr;
this->ReadStream = nullptr;
}
void cmServerPipeConnection::Connect(uv_stream_t* server)
{
- if (this->ClientPipe.data == this) {
+ if (this->ClientPipe) {
// Accept and close all pipes but the first:
- uv_pipe_t rejectPipe;
+ uv_pipe_t* rejectPipe = new uv_pipe_t;
- uv_pipe_init(this->Loop(), &rejectPipe, 0);
- auto rejecter = reinterpret_cast<uv_stream_t*>(&rejectPipe);
+ uv_pipe_init(this->Loop(), rejectPipe, 0);
+ auto rejecter = reinterpret_cast<uv_stream_t*>(rejectPipe);
uv_accept(server, rejecter);
- uv_close(reinterpret_cast<uv_handle_t*>(rejecter), nullptr);
+ uv_close(reinterpret_cast<uv_handle_t*>(rejecter), &on_pipe_close);
return;
}
- uv_pipe_init(this->Loop(), &this->ClientPipe, 0);
- this->ClientPipe.data = this;
+ this->ClientPipe = new uv_pipe_t;
+ uv_pipe_init(this->Loop(), this->ClientPipe, 0);
+ this->ClientPipe->data = this;
auto client = reinterpret_cast<uv_stream_t*>(&this->ClientPipe);
if (uv_accept(server, client) != 0) {
uv_close(reinterpret_cast<uv_handle_t*>(client), nullptr);
diff --git a/Source/cmServerConnection.h b/Source/cmServerConnection.h
index 78842e7..3efe28d 100644
--- a/Source/cmServerConnection.h
+++ b/Source/cmServerConnection.h
@@ -24,7 +24,7 @@ public:
bool ProcessEvents(std::string* errorMessage);
void ReadData(const std::string& data);
- void HandleEof();
+ void TriggerShutdown();
void WriteData(const std::string& data);
void ProcessNextRequest();
@@ -51,6 +51,8 @@ private:
uv_loop_t* mLoop = nullptr;
cmFileMonitor* mFileMonitor = nullptr;
cmServer* Server = nullptr;
+ uv_signal_t* SIGINTHandler = nullptr;
+ uv_signal_t* SIGHUPHandler = nullptr;
friend class LoopGuard;
};
@@ -58,6 +60,7 @@ private:
class cmServerStdIoConnection : public cmServerConnection
{
public:
+ cmServerStdIoConnection();
bool DoSetup(std::string* errorMessage) override;
void TearDown() override;
@@ -65,10 +68,12 @@ public:
private:
typedef union
{
- uv_tty_t tty;
- uv_pipe_t pipe;
+ uv_tty_t* tty;
+ uv_pipe_t* pipe;
} InOutUnion;
+ bool usesTty = false;
+
InOutUnion Input;
InOutUnion Output;
};
@@ -85,6 +90,6 @@ public:
private:
const std::string PipeName;
- uv_pipe_t ServerPipe;
- uv_pipe_t ClientPipe;
+ uv_pipe_t* ServerPipe = nullptr;
+ uv_pipe_t* ClientPipe = nullptr;
};
diff --git a/Source/cmVS140CLFlagTable.h b/Source/cmVS140CLFlagTable.h
new file mode 100644
index 0000000..317cc18
--- /dev/null
+++ b/Source/cmVS140CLFlagTable.h
@@ -0,0 +1,237 @@
+static cmVS7FlagTable cmVS140CLFlagTable[] = {
+
+ // Enum Properties
+ { "DebugInformationFormat", "", "None", "None", 0 },
+ { "DebugInformationFormat", "Z7", "C7 compatible", "OldStyle", 0 },
+ { "DebugInformationFormat", "Zi", "Program Database", "ProgramDatabase", 0 },
+ { "DebugInformationFormat", "ZI", "Program Database for Edit And Continue",
+ "EditAndContinue", 0 },
+
+ { "WarningLevel", "W0", "Turn Off All Warnings", "TurnOffAllWarnings", 0 },
+ { "WarningLevel", "W1", "Level1", "Level1", 0 },
+ { "WarningLevel", "W2", "Level2", "Level2", 0 },
+ { "WarningLevel", "W3", "Level3", "Level3", 0 },
+ { "WarningLevel", "W4", "Level4", "Level4", 0 },
+ { "WarningLevel", "Wall", "EnableAllWarnings", "EnableAllWarnings", 0 },
+
+ { "Optimization", "", "Custom", "Custom", 0 },
+ { "Optimization", "Od", "Disabled", "Disabled", 0 },
+ { "Optimization", "O1", "Minimize Size", "MinSpace", 0 },
+ { "Optimization", "O2", "Maximize Speed", "MaxSpeed", 0 },
+ { "Optimization", "Ox", "Full Optimization", "Full", 0 },
+
+ { "InlineFunctionExpansion", "", "Default", "Default", 0 },
+ { "InlineFunctionExpansion", "Ob0", "Disabled", "Disabled", 0 },
+ { "InlineFunctionExpansion", "Ob1", "Only __inline", "OnlyExplicitInline",
+ 0 },
+ { "InlineFunctionExpansion", "Ob2", "Any Suitable", "AnySuitable", 0 },
+
+ { "FavorSizeOrSpeed", "Os", "Favor small code", "Size", 0 },
+ { "FavorSizeOrSpeed", "Ot", "Favor fast code", "Speed", 0 },
+ { "FavorSizeOrSpeed", "", "Neither", "Neither", 0 },
+
+ { "ExceptionHandling", "EHa", "Yes with SEH Exceptions", "Async", 0 },
+ { "ExceptionHandling", "EHsc", "Yes", "Sync", 0 },
+ { "ExceptionHandling", "EHs", "Yes with Extern C functions", "SyncCThrow",
+ 0 },
+ { "ExceptionHandling", "", "No", "false", 0 },
+
+ { "BasicRuntimeChecks", "RTCs", "Stack Frames", "StackFrameRuntimeCheck",
+ 0 },
+ { "BasicRuntimeChecks", "RTCu", "Uninitialized variables",
+ "UninitializedLocalUsageCheck", 0 },
+ { "BasicRuntimeChecks", "RTC1", "Both (/RTC1, equiv. to /RTCsu)",
+ "EnableFastChecks", 0 },
+ { "BasicRuntimeChecks", "", "Default", "Default", 0 },
+
+ { "RuntimeLibrary", "MT", "Multi-threaded", "MultiThreaded", 0 },
+ { "RuntimeLibrary", "MTd", "Multi-threaded Debug", "MultiThreadedDebug", 0 },
+ { "RuntimeLibrary", "MD", "Multi-threaded DLL", "MultiThreadedDLL", 0 },
+ { "RuntimeLibrary", "MDd", "Multi-threaded Debug DLL",
+ "MultiThreadedDebugDLL", 0 },
+
+ { "StructMemberAlignment", "Zp1", "1 Byte", "1Byte", 0 },
+ { "StructMemberAlignment", "Zp2", "2 Bytes", "2Bytes", 0 },
+ { "StructMemberAlignment", "Zp4", "4 Byte", "4Bytes", 0 },
+ { "StructMemberAlignment", "Zp8", "8 Bytes", "8Bytes", 0 },
+ { "StructMemberAlignment", "Zp16", "16 Bytes", "16Bytes", 0 },
+ { "StructMemberAlignment", "", "Default", "Default", 0 },
+
+ { "BufferSecurityCheck", "GS-", "Disable Security Check", "false", 0 },
+ { "BufferSecurityCheck", "GS", "Enable Security Check", "true", 0 },
+
+ { "EnableEnhancedInstructionSet", "arch:SSE", "Streaming SIMD Extensions",
+ "StreamingSIMDExtensions", 0 },
+ { "EnableEnhancedInstructionSet", "arch:SSE2", "Streaming SIMD Extensions 2",
+ "StreamingSIMDExtensions2", 0 },
+ { "EnableEnhancedInstructionSet", "arch:AVX", "Advanced Vector Extensions",
+ "AdvancedVectorExtensions", 0 },
+ { "EnableEnhancedInstructionSet", "arch:AVX2",
+ "Advanced Vector Extensions 2", "AdvancedVectorExtensions2", 0 },
+ { "EnableEnhancedInstructionSet", "arch:IA32", "No Enhanced Instructions",
+ "NoExtensions", 0 },
+ { "EnableEnhancedInstructionSet", "", "Not Set", "NotSet", 0 },
+
+ { "FloatingPointModel", "fp:precise", "Precise", "Precise", 0 },
+ { "FloatingPointModel", "fp:strict", "Strict", "Strict", 0 },
+ { "FloatingPointModel", "fp:fast", "Fast", "Fast", 0 },
+
+ { "PrecompiledHeader", "Yc", "Create", "Create",
+ cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
+ { "PrecompiledHeader", "Yu", "Use", "Use",
+ cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
+ { "PrecompiledHeader", "", "Not Using Precompiled Headers", "NotUsing", 0 },
+
+ { "AssemblerOutput", "", "No Listing", "NoListing", 0 },
+ { "AssemblerOutput", "FA", "Assembly-Only Listing", "AssemblyCode", 0 },
+ { "AssemblerOutput", "FAc", "Assembly With Machine Code",
+ "AssemblyAndMachineCode", 0 },
+ { "AssemblerOutput", "FAs", "Assembly With Source Code",
+ "AssemblyAndSourceCode", 0 },
+ { "AssemblerOutput", "FAcs", "Assembly, Machine Code and Source", "All", 0 },
+
+ { "CallingConvention", "Gd", "__cdecl", "Cdecl", 0 },
+ { "CallingConvention", "Gr", "__fastcall", "FastCall", 0 },
+ { "CallingConvention", "Gz", "__stdcall", "StdCall", 0 },
+ { "CallingConvention", "Gv", "__vectorcall", "VectorCall", 0 },
+
+ { "CompileAs", "", "Default", "Default", 0 },
+ { "CompileAs", "TC", "Compile as C Code", "CompileAsC", 0 },
+ { "CompileAs", "TP", "Compile as C++ Code", "CompileAsCpp", 0 },
+
+ { "ErrorReporting", "errorReport:none", "Do Not Send Report", "None", 0 },
+ { "ErrorReporting", "errorReport:prompt", "Prompt Immediately", "Prompt",
+ 0 },
+ { "ErrorReporting", "errorReport:queue", "Queue For Next Login", "Queue",
+ 0 },
+ { "ErrorReporting", "errorReport:send", "Send Automatically", "Send", 0 },
+
+ { "CompileAsManaged", "", "No Common Language RunTime Support", "false", 0 },
+ { "CompileAsManaged", "clr", "Common Language RunTime Support", "true", 0 },
+ { "CompileAsManaged", "clr:pure",
+ "Pure MSIL Common Language RunTime Support", "Pure", 0 },
+ { "CompileAsManaged", "clr:safe",
+ "Safe MSIL Common Language RunTime Support", "Safe", 0 },
+ { "CompileAsManaged", "clr:oldSyntax",
+ "Common Language RunTime Support, Old Syntax", "OldSyntax", 0 },
+
+ { "CppLanguageStandard", "", "Default", "Default", 0 },
+ { "CppLanguageStandard", "std=c++98", "C++03", "c++98", 0 },
+ { "CppLanguageStandard", "std=c++11", "C++11", "c++11", 0 },
+ { "CppLanguageStandard", "std=c++1y", "C++14", "c++1y", 0 },
+ { "CppLanguageStandard", "std=c++14", "C++14", "c++1y", 0 },
+ { "CppLanguageStandard", "std=gnu++98", "C++03 (GNU Dialect)", "gnu++98",
+ 0 },
+ { "CppLanguageStandard", "std=gnu++11", "C++11 (GNU Dialect)", "gnu++11",
+ 0 },
+ { "CppLanguageStandard", "std=gnu++1y", "C++14 (GNU Dialect)", "gnu++1y",
+ 0 },
+ { "CppLanguageStandard", "std=gnu++14", "C++14 (GNU Dialect)", "gnu++1y",
+ 0 },
+
+ // Bool Properties
+ { "CompileAsWinRT", "ZW", "", "true", 0 },
+ { "WinRTNoStdLib", "ZW:nostdlib", "", "true", 0 },
+ { "SuppressStartupBanner", "nologo", "", "true", 0 },
+ { "TreatWarningAsError", "WX-", "", "false", 0 },
+ { "TreatWarningAsError", "WX", "", "true", 0 },
+ { "SDLCheck", "sdl-", "", "false", 0 },
+ { "SDLCheck", "sdl", "", "true", 0 },
+ { "IntrinsicFunctions", "Oi", "", "true", 0 },
+ { "OmitFramePointers", "Oy-", "", "false", 0 },
+ { "OmitFramePointers", "Oy", "", "true", 0 },
+ { "EnableFiberSafeOptimizations", "GT", "", "true", 0 },
+ { "WholeProgramOptimization", "GL", "", "true", 0 },
+ { "UndefineAllPreprocessorDefinitions", "u", "", "true", 0 },
+ { "IgnoreStandardIncludePath", "X", "", "true", 0 },
+ { "PreprocessToFile", "P", "", "true", 0 },
+ { "PreprocessSuppressLineNumbers", "EP", "", "true", 0 },
+ { "PreprocessKeepComments", "C", "", "true", 0 },
+ { "StringPooling", "GF-", "", "false", 0 },
+ { "StringPooling", "GF", "", "true", 0 },
+ { "MinimalRebuild", "Gm-", "", "false", 0 },
+ { "MinimalRebuild", "Gm", "", "true", 0 },
+ { "SmallerTypeCheck", "RTCc", "", "true", 0 },
+ { "FunctionLevelLinking", "Gy-", "", "false", 0 },
+ { "FunctionLevelLinking", "Gy", "", "true", 0 },
+ { "EnableParallelCodeGeneration", "Qpar-", "", "false", 0 },
+ { "EnableParallelCodeGeneration", "Qpar", "", "true", 0 },
+ { "FloatingPointExceptions", "fp:except-", "", "false", 0 },
+ { "FloatingPointExceptions", "fp:except", "", "true", 0 },
+ { "CreateHotpatchableImage", "hotpatch", "", "true", 0 },
+ { "DisableLanguageExtensions", "Za", "", "true", 0 },
+ { "TreatWChar_tAsBuiltInType", "Zc:wchar_t-", "", "false", 0 },
+ { "TreatWChar_tAsBuiltInType", "Zc:wchar_t", "", "true", 0 },
+ { "ForceConformanceInForLoopScope", "Zc:forScope-", "", "false", 0 },
+ { "ForceConformanceInForLoopScope", "Zc:forScope", "", "true", 0 },
+ { "RuntimeTypeInfo", "GR-", "", "false", 0 },
+ { "RuntimeTypeInfo", "GR", "", "true", 0 },
+ { "OpenMPSupport", "openmp-", "", "false", 0 },
+ { "OpenMPSupport", "openmp", "", "true", 0 },
+ { "ExpandAttributedSource", "Fx", "", "true", 0 },
+ { "UseUnicodeForAssemblerListing", "FAu", "", "true", 0 },
+ { "ShowIncludes", "showIncludes", "", "true", 0 },
+ { "EnablePREfast", "analyze-", "", "false", 0 },
+ { "EnablePREfast", "analyze", "", "true", 0 },
+ { "UseFullPaths", "FC", "", "true", 0 },
+ { "OmitDefaultLibName", "Zl", "", "true", 0 },
+
+ // Bool Properties With Argument
+ { "MultiProcessorCompilation", "MP", "", "true",
+ cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
+ { "ProcessorNumber", "MP", "Multi-processor Compilation", "",
+ cmVS7FlagTable::UserValueRequired },
+ { "GenerateXMLDocumentationFiles", "doc", "", "true",
+ cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
+ { "XMLDocumentationFileName", "doc", "Generate XML Documentation Files", "",
+ cmVS7FlagTable::UserValueRequired },
+ { "BrowseInformation", "FR", "", "true",
+ cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
+ { "BrowseInformationFile", "FR", "Enable Browse Information", "",
+ cmVS7FlagTable::UserValueRequired },
+
+ // String List Properties
+ { "AdditionalIncludeDirectories", "I", "Additional Include Directories", "",
+ cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
+ { "AdditionalUsingDirectories", "AI", "Additional #using Directories", "",
+ cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
+ { "PreprocessorDefinitions", "D ", "Preprocessor Definitions", "",
+ cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
+ { "UndefinePreprocessorDefinitions", "U",
+ "Undefine Preprocessor Definitions", "",
+ cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
+ { "DisableSpecificWarnings", "wd", "Disable Specific Warnings", "",
+ cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
+ { "ForcedIncludeFiles", "FI", "Forced Include File", "",
+ cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
+ { "ForcedUsingFiles", "FU", "Forced #using File", "",
+ cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
+ { "PREfastLog", "analyze:log", "Code Analysis Log", "",
+ cmVS7FlagTable::UserFollowing },
+ { "PREfastAdditionalPlugins", "analyze:plugin",
+ "Additional Code Analysis Native plugins", "",
+ cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
+ { "TreatSpecificWarningsAsErrors", "we", "Treat Specific Warnings As Errors",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
+
+ // String Properties
+ // Skip [TrackerLogDirectory] - no command line Switch.
+ { "PreprocessOutputPath", "Fi", "Preprocess Output Path", "",
+ cmVS7FlagTable::UserValue },
+ { "PrecompiledHeaderFile", "Yc", "Precompiled Header Name", "",
+ cmVS7FlagTable::UserValueRequired },
+ { "PrecompiledHeaderFile", "Yu", "Precompiled Header Name", "",
+ cmVS7FlagTable::UserValueRequired },
+ { "PrecompiledHeaderOutputFile", "Fp", "Precompiled Header Output File", "",
+ cmVS7FlagTable::UserValue },
+ { "AssemblerListingLocation", "Fa", "ASM List Location", "",
+ cmVS7FlagTable::UserValue },
+ { "ObjectFileName", "Fo", "Object File Name", "",
+ cmVS7FlagTable::UserValue },
+ { "ProgramDataBaseFileName", "Fd", "Program Database File Name", "",
+ cmVS7FlagTable::UserValue },
+ // Skip [XMLDocumentationFileName] - no command line Switch.
+ // Skip [BrowseInformationFile] - no command line Switch.
+ // Skip [AdditionalOptions] - no command line Switch.
+ { 0, 0, 0, 0, 0 }
+};
diff --git a/Source/cmVS14CLFlagTable.h b/Source/cmVS141CLFlagTable.h
index c48db68..895b3e8 100644
--- a/Source/cmVS14CLFlagTable.h
+++ b/Source/cmVS141CLFlagTable.h
@@ -1,4 +1,4 @@
-static cmVS7FlagTable cmVS14CLFlagTable[] = {
+static cmVS7FlagTable cmVS141CLFlagTable[] = {
// Enum Properties
{ "DebugInformationFormat", "", "None", "None", 0 },
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index d81f59d..82f4b99 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -25,7 +25,8 @@
#include "cmVS12LinkFlagTable.h"
#include "cmVS12MASMFlagTable.h"
#include "cmVS12RCFlagTable.h"
-#include "cmVS14CLFlagTable.h"
+#include "cmVS140CLFlagTable.h"
+#include "cmVS141CLFlagTable.h"
#include "cmVS14LibFlagTable.h"
#include "cmVS14LinkFlagTable.h"
#include "cmVS14MASMFlagTable.h"
@@ -43,7 +44,13 @@ cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetClFlagTable() const
cmGlobalVisualStudioGenerator::VSVersion v =
this->LocalGenerator->GetVersion();
if (v >= cmGlobalVisualStudioGenerator::VS14) {
- return cmVS14CLFlagTable;
+ // FIXME: All flag table selection should be based on the toolset name.
+ // See issue #16153. For now, treat VS 15's toolset as a special case.
+ const char* toolset = this->GlobalGenerator->GetPlatformToolset();
+ if (toolset && cmHasLiteralPrefix(toolset, "v141")) {
+ return cmVS141CLFlagTable;
+ }
+ return cmVS140CLFlagTable;
} else if (v >= cmGlobalVisualStudioGenerator::VS12) {
return cmVS12CLFlagTable;
} else if (v == cmGlobalVisualStudioGenerator::VS11) {
@@ -2736,8 +2743,10 @@ void cmVisualStudio10TargetGenerator::WriteWinRTPackageCertificateKeyFile()
(*this->BuildFileStream) << cmVS10EscapeXML(artifactDir)
<< "\\</AppxPackageArtifactsDir>\n";
this->WriteString("<ProjectPriFullPath>", 2);
- (*this->BuildFileStream) << cmVS10EscapeXML(artifactDir)
- << "\\resources.pri</ProjectPriFullPath>\n";
+ std::string resourcePriFile =
+ this->DefaultArtifactDir + "/resources.pri";
+ this->ConvertToWindowsSlash(resourcePriFile);
+ (*this->BuildFileStream) << resourcePriFile << "</ProjectPriFullPath>\n";
// If we are missing files and we don't have a certificate and
// aren't targeting WP8.0, add a default certificate
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 14124f8..c8cf465 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -929,7 +929,7 @@ void cmake::GetRegisteredGenerators(
gen != genList.end(); ++gen) {
GeneratorInfo info;
info.name = cmExternalMakefileProjectGenerator::CreateFullGeneratorName(
- (*i)->GetName(), *gen);
+ *gen, (*i)->GetName());
info.baseName = *gen;
info.extraName = (*i)->GetName();
info.supportsPlatform = false;
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index c97af25..5da715f 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -2716,17 +2716,15 @@ unsigned long SystemTools::FileLength(const std::string& filename)
return length;
}
-int SystemTools::Strucmp(const char *s1, const char *s2)
-{
- // lifted from Graphvis http://www.graphviz.org
- while ((*s1 != '\0')
- && (tolower(*s1) == tolower(*s2)))
- {
- s1++;
- s2++;
- }
-
- return tolower(*s1) - tolower(*s2);
+int SystemTools::Strucmp(const char* l, const char* r)
+{
+ int lc;
+ int rc;
+ do {
+ lc = tolower(*l++);
+ rc = tolower(*r++);
+ } while(lc == rc && lc);
+ return lc - rc;
}
// return file's modified time