diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/CTest/cmProcess.cxx | 20 | ||||
-rw-r--r-- | Source/CTest/cmProcess.h | 4 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 9 | ||||
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmSourceGroup.cxx | 49 | ||||
-rw-r--r-- | Source/cmSourceGroup.h | 12 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 11 |
8 files changed, 52 insertions, 57 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 8fa82c5..797b39c 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 10) -set(CMake_VERSION_PATCH 20180117) +set(CMake_VERSION_PATCH 20180118) #set(CMake_VERSION_RC 1) diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx index c8806a7..e332a77 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -5,19 +5,19 @@ #include "cmCTest.h" #include "cmCTestRunTest.h" #include "cmCTestTestHandler.h" -#include "cmProcessOutput.h" #include "cmsys/Process.h" #include <algorithm> #include <fcntl.h> #include <iostream> #include <signal.h> -#include <stdint.h> #include <string> #if !defined(_WIN32) #include <unistd.h> #endif +#define CM_PROCESS_BUF_SIZE 65536 + #if defined(_WIN32) && !defined(__CYGWIN__) #include <io.h> @@ -60,6 +60,7 @@ static int cmProcessGetPipes(int* fds) cmProcess::cmProcess(cmCTestRunTest& runner) : Runner(runner) + , Conv(cmProcessOutput::UTF8, CM_PROCESS_BUF_SIZE) { this->Timeout = std::chrono::duration<double>::zero(); this->TotalTime = std::chrono::duration<double>::zero(); @@ -232,9 +233,7 @@ void cmProcess::OnRead(ssize_t nread, const uv_buf_t* buf) std::string line; if (nread > 0) { std::string strdata; - cmProcessOutput processOutput(cmProcessOutput::UTF8, - static_cast<unsigned int>(buf->len)); - processOutput.DecodeText(buf->base, static_cast<size_t>(nread), strdata); + this->Conv.DecodeText(buf->base, static_cast<size_t>(nread), strdata); this->Output.insert(this->Output.end(), strdata.begin(), strdata.end()); while (this->Output.GetLine(line)) { @@ -245,6 +244,10 @@ void cmProcess::OnRead(ssize_t nread, const uv_buf_t* buf) return; } + if (nread == 0) { + return; + } + // The process will provide no more data. if (nread != UV_EOF) { auto error = static_cast<int>(nread); @@ -258,6 +261,7 @@ void cmProcess::OnRead(ssize_t nread, const uv_buf_t* buf) } this->ReadHandleClosed = true; + this->PipeReader.reset(); if (this->ProcessHandleClosed) { uv_timer_stop(this->Timer); this->Runner.FinalizeTest(); @@ -271,10 +275,10 @@ void cmProcess::OnAllocateCB(uv_handle_t* handle, size_t suggested_size, self->OnAllocate(suggested_size, buf); } -void cmProcess::OnAllocate(size_t suggested_size, uv_buf_t* buf) +void cmProcess::OnAllocate(size_t /*suggested_size*/, uv_buf_t* buf) { - if (this->Buf.size() < suggested_size) { - this->Buf.resize(suggested_size); + if (this->Buf.size() != CM_PROCESS_BUF_SIZE) { + this->Buf.resize(CM_PROCESS_BUF_SIZE); } *buf = diff --git a/Source/CTest/cmProcess.h b/Source/CTest/cmProcess.h index 9250896..633be24 100644 --- a/Source/CTest/cmProcess.h +++ b/Source/CTest/cmProcess.h @@ -5,13 +5,14 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include "cmProcessOutput.h" #include "cmUVHandlePtr.h" #include "cm_uv.h" #include <chrono> #include <stddef.h> +#include <stdint.h> #include <string> -#include <sys/types.h> #include <vector> class cmCTestRunTest; @@ -80,6 +81,7 @@ private: std::vector<char> Buf; cmCTestRunTest& Runner; + cmProcessOutput Conv; int Signal = 0; cmProcess::State ProcessState = cmProcess::State::Starting; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b42495c..eeeb54f 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1965,7 +1965,7 @@ cmSourceGroup* cmMakefile::GetSourceGroup( if (sg != nullptr) { // iterate through its children to find match source group for (unsigned int i = 1; i < name.size(); ++i) { - sg = sg->LookupChild(name[i].c_str()); + sg = sg->LookupChild(name[i]); if (sg == nullptr) { break; } @@ -2009,7 +2009,7 @@ void cmMakefile::AddSourceGroup(const std::vector<std::string>& name, if (i == -1) { // group does not exist nor belong to any existing group // add its first component - this->SourceGroups.push_back(cmSourceGroup(name[0].c_str(), regex)); + this->SourceGroups.push_back(cmSourceGroup(name[0], regex)); sg = this->GetSourceGroup(currentName); i = 0; // last component found } @@ -2019,9 +2019,8 @@ void cmMakefile::AddSourceGroup(const std::vector<std::string>& name, } // build the whole source group path for (++i; i <= lastElement; ++i) { - sg->AddChild( - cmSourceGroup(name[i].c_str(), nullptr, sg->GetFullName().c_str())); - sg = sg->LookupChild(name[i].c_str()); + sg->AddChild(cmSourceGroup(name[i], nullptr, sg->GetFullName().c_str())); + sg = sg->LookupChild(name[i]); } sg->SetGroupRegex(regex); diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index e0cc35a..594e0f5 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -760,7 +760,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement() /*implicitOuts=*/cmNinjaDeps(), explicitDeps, implicitDeps, orderOnlyDeps, vars, rspfile, commandLineLengthLimit, &usedResponseFile); - this->WriteDeviceLinkRule(usedResponseFile); + this->WriteDeviceLinkRule(false); } void cmNinjaNormalTargetGenerator::WriteLinkStatement() diff --git a/Source/cmSourceGroup.cxx b/Source/cmSourceGroup.cxx index 18bcb49..12ef62b 100644 --- a/Source/cmSourceGroup.cxx +++ b/Source/cmSourceGroup.cxx @@ -8,7 +8,7 @@ public: std::vector<cmSourceGroup> GroupChildren; }; -cmSourceGroup::cmSourceGroup(const char* name, const char* regex, +cmSourceGroup::cmSourceGroup(const std::string& name, const char* regex, const char* parentName) : Name(name) { @@ -70,14 +70,14 @@ std::string const& cmSourceGroup::GetFullName() const return this->FullName; } -bool cmSourceGroup::MatchesRegex(const char* name) +bool cmSourceGroup::MatchesRegex(const std::string& name) { return this->GroupRegex.find(name); } -bool cmSourceGroup::MatchesFiles(const char* name) +bool cmSourceGroup::MatchesFiles(const std::string& name) const { - return this->GroupFiles.find(name) != this->GroupFiles.end(); + return this->GroupFiles.find(name) != this->GroupFiles.cend(); } void cmSourceGroup::AssignSource(const cmSourceFile* sf) @@ -95,21 +95,12 @@ void cmSourceGroup::AddChild(cmSourceGroup const& child) this->Internal->GroupChildren.push_back(child); } -cmSourceGroup* cmSourceGroup::LookupChild(const char* name) const +cmSourceGroup* cmSourceGroup::LookupChild(const std::string& name) { - // initializing iterators - std::vector<cmSourceGroup>::const_iterator iter = - this->Internal->GroupChildren.begin(); - const std::vector<cmSourceGroup>::const_iterator end = - this->Internal->GroupChildren.end(); - - // st - for (; iter != end; ++iter) { - std::string const& sgName = iter->GetName(); - + for (cmSourceGroup& group : this->Internal->GroupChildren) { // look if descenened is the one were looking for - if (sgName == name) { - return const_cast<cmSourceGroup*>(&(*iter)); // if it so return it + if (group.GetName() == name) { + return (&group); // if it so return it } } @@ -117,19 +108,13 @@ cmSourceGroup* cmSourceGroup::LookupChild(const char* name) const return nullptr; } -cmSourceGroup* cmSourceGroup::MatchChildrenFiles(const char* name) +cmSourceGroup* cmSourceGroup::MatchChildrenFiles(const std::string& name) { - // initializing iterators - std::vector<cmSourceGroup>::iterator iter = - this->Internal->GroupChildren.begin(); - std::vector<cmSourceGroup>::iterator end = - this->Internal->GroupChildren.end(); - if (this->MatchesFiles(name)) { return this; } - for (; iter != end; ++iter) { - cmSourceGroup* result = iter->MatchChildrenFiles(name); + for (cmSourceGroup& group : this->Internal->GroupChildren) { + cmSourceGroup* result = group.MatchChildrenFiles(name); if (result) { return result; } @@ -137,16 +122,10 @@ cmSourceGroup* cmSourceGroup::MatchChildrenFiles(const char* name) return nullptr; } -cmSourceGroup* cmSourceGroup::MatchChildrenRegex(const char* name) +cmSourceGroup* cmSourceGroup::MatchChildrenRegex(const std::string& name) { - // initializing iterators - std::vector<cmSourceGroup>::iterator iter = - this->Internal->GroupChildren.begin(); - std::vector<cmSourceGroup>::iterator end = - this->Internal->GroupChildren.end(); - - for (; iter != end; ++iter) { - cmSourceGroup* result = iter->MatchChildrenRegex(name); + for (cmSourceGroup& group : this->Internal->GroupChildren) { + cmSourceGroup* result = group.MatchChildrenRegex(name); if (result) { return result; } diff --git a/Source/cmSourceGroup.h b/Source/cmSourceGroup.h index 7c7c35f..b39f8dd 100644 --- a/Source/cmSourceGroup.h +++ b/Source/cmSourceGroup.h @@ -26,7 +26,7 @@ class cmSourceGroupInternals; class cmSourceGroup { public: - cmSourceGroup(const char* name, const char* regex, + cmSourceGroup(const std::string& name, const char* regex, const char* parentName = nullptr); cmSourceGroup(cmSourceGroup const& r); ~cmSourceGroup(); @@ -50,7 +50,7 @@ public: /** * Looks up child and returns it */ - cmSourceGroup* LookupChild(const char* name) const; + cmSourceGroup* LookupChild(const std::string& name); /** * Get the name of this group. @@ -65,23 +65,23 @@ public: /** * Check if the given name matches this group's regex. */ - bool MatchesRegex(const char* name); + bool MatchesRegex(const std::string& name); /** * Check if the given name matches this group's explicit file list. */ - bool MatchesFiles(const char* name); + bool MatchesFiles(const std::string& name) const; /** * Check if the given name matches this group's explicit file list * in children. */ - cmSourceGroup* MatchChildrenFiles(const char* name); + cmSourceGroup* MatchChildrenFiles(const std::string& name); /** * Check if the given name matches this group's regex in children. */ - cmSourceGroup* MatchChildrenRegex(const char* name); + cmSourceGroup* MatchChildrenRegex(const std::string& name); /** * Assign the given source file to this group. Used only by diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 6d81f95..1b09600 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2667,6 +2667,7 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions( cudaOptions.AddFlag("GPUDebugInfo", "false"); } + bool notPtx = true; if (this->GeneratorTarget->GetPropertyAsBool("CUDA_SEPARABLE_COMPILATION")) { cudaOptions.AddFlag("GenerateRelocatableDeviceCode", "true"); } else if (this->GeneratorTarget->GetPropertyAsBool( @@ -2675,6 +2676,16 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions( // We drop the %(Extension) component as CMake expects all PTX files // to not have the source file extension at all cudaOptions.AddFlag("CompileOut", "$(IntDir)%(Filename).ptx"); + notPtx = false; + } + + if (notPtx && + cmSystemTools::VersionCompareGreaterEq( + "8.0", this->GlobalGenerator->GetPlatformToolsetCudaString())) { + // Explicitly state that we want this file to be treated as a + // CUDA file no matter what the file extensions is + // This is only needed for < CUDA 9 + cudaOptions.AppendFlagString("AdditionalOptions", "-x cu"); } // CUDA automatically passes the proper '--machine' flag to nvcc |