diff options
-rw-r--r-- | Modules/CTestCoverageCollectGCOV.cmake | 18 | ||||
-rw-r--r-- | Modules/Platform/Darwin-Initialize.cmake | 4 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesLongMessageForm.cxx | 35 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesLongMessageForm.h | 6 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesMainForm.cxx | 24 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesMainForm.h | 2 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 41 | ||||
-rw-r--r-- | Source/cmLocalGenerator.h | 1 | ||||
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 4 |
10 files changed, 100 insertions, 37 deletions
diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index ff48cc2dc0..b498086c9c 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -137,11 +137,23 @@ function(ctest_coverage_collect_gcov) if(NOT DEFINED GCOV_GCOV_OPTIONS) set(GCOV_GCOV_OPTIONS -b -x) endif() + if (GCOV_QUIET) + set(coverage_out_opts + OUTPUT_QUIET + ERROR_QUIET + ) + else() + set(coverage_out_opts + OUTPUT_FILE "${coverage_dir}/gcov.log" + ERROR_FILE "${coverage_dir}/gcov.log" + ) + endif() execute_process(COMMAND ${gcov_command} ${GCOV_GCOV_OPTIONS} ${gcda_files} - OUTPUT_VARIABLE out RESULT_VARIABLE res - WORKING_DIRECTORY ${coverage_dir}) + WORKING_DIRECTORY ${coverage_dir} + ${coverage_out_opts} + ) if (GCOV_DELETE) file(REMOVE ${gcda_files}) @@ -149,7 +161,7 @@ function(ctest_coverage_collect_gcov) if(NOT "${res}" EQUAL 0) if (NOT GCOV_QUIET) - message(STATUS "Error running gcov: ${res} ${out}") + message(STATUS "Error running gcov: ${res}, see\n ${coverage_dir}/gcov.log") endif() endif() # create json file with project information diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake index 729217c54b..80e668e5a6 100644 --- a/Modules/Platform/Darwin-Initialize.cmake +++ b/Modules/Platform/Darwin-Initialize.cmake @@ -136,7 +136,7 @@ endfunction() # Handle multi-arch sysroots. Do this before CMAKE_OSX_SYSROOT is # transformed into a path, so that we know the sysroot name. function(_apple_resolve_multi_arch_sysroots) - if(CMAKE_APPLE_ARCH_SYSROOTS) + if(DEFINED CMAKE_APPLE_ARCH_SYSROOTS) return() # Already cached endif() @@ -202,7 +202,7 @@ function(_apple_resolve_multi_arch_sysroots) list(APPEND _arch_sysroots ${_arch_sysroot}) else() message(WARNING "No SDK found for architecture '${arch}'") - list(APPEND _arch_sysroots "") # Placeholder + list(APPEND _arch_sysroots "${arch}-SDK-NOTFOUND") endif() endforeach() diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 6ccb754291..b192df2203 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 17) -set(CMake_VERSION_PATCH 20200408) +set(CMake_VERSION_PATCH 20200409) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx index 806e663e9e..afd2b6b909 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.cxx +++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx @@ -35,6 +35,22 @@ cmCursesLongMessageForm::~cmCursesLongMessageForm() } } +void cmCursesLongMessageForm::UpdateContent(std::string const& output, + std::string const& title) +{ + this->Title = title; + + if (!output.empty() && this->Messages.size() < MAX_CONTENT_SIZE) { + this->Messages.append("\n" + output); + form_driver(this->Form, REQ_NEW_LINE); + this->DrawMessage(output.c_str()); + } + + this->UpdateStatusBar(); + touchwin(stdscr); + refresh(); +} + void cmCursesLongMessageForm::UpdateStatusBar() { int x; @@ -109,8 +125,6 @@ void cmCursesLongMessageForm::Render(int /*left*/, int /*top*/, int /*width*/, this->Form = nullptr; } - const char* msg = this->Messages.c_str(); - if (this->Fields[0]) { free_field(this->Fields[0]); this->Fields[0] = nullptr; @@ -123,9 +137,18 @@ void cmCursesLongMessageForm::Render(int /*left*/, int /*top*/, int /*width*/, this->Form = new_form(this->Fields); post_form(this->Form); - int i = 0; form_driver(this->Form, REQ_BEG_FIELD); - while (msg[i] != '\0' && i < 60000) { + this->DrawMessage(this->Messages.c_str()); + + this->UpdateStatusBar(); + touchwin(stdscr); + refresh(); +} + +void cmCursesLongMessageForm::DrawMessage(const char* msg) const +{ + int i = 0; + while (msg[i] != '\0' && i < MAX_CONTENT_SIZE) { if (msg[i] == '\n' && msg[i + 1] != '\0') { form_driver(this->Form, REQ_NEW_LINE); } else { @@ -138,10 +161,6 @@ void cmCursesLongMessageForm::Render(int /*left*/, int /*top*/, int /*width*/, } else { form_driver(this->Form, REQ_BEG_FIELD); } - - this->UpdateStatusBar(); - touchwin(stdscr); - refresh(); } void cmCursesLongMessageForm::HandleInput() diff --git a/Source/CursesDialog/cmCursesLongMessageForm.h b/Source/CursesDialog/cmCursesLongMessageForm.h index 88efe62173..da9fea2b15 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.h +++ b/Source/CursesDialog/cmCursesLongMessageForm.h @@ -27,6 +27,8 @@ public: cmCursesLongMessageForm(cmCursesLongMessageForm const&) = delete; cmCursesLongMessageForm& operator=(cmCursesLongMessageForm const&) = delete; + void UpdateContent(std::string const& output, std::string const& title); + // Description: // Handle user input. void HandleInput() override; @@ -47,6 +49,10 @@ public: void UpdateStatusBar() override; protected: + static constexpr int MAX_CONTENT_SIZE = 60000; + + void DrawMessage(const char* msg) const; + std::string Messages; std::string Title; ScrollBehavior Scrolling; diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 7752a684bb..df3428339a 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -454,11 +454,11 @@ void cmCursesMainForm::UpdateProgress(const std::string& msg, float prog) this->LastProgress.append(progressBarCompleted, '#'); this->LastProgress.append(progressBarWidth - progressBarCompleted, ' '); this->LastProgress += "] " + msg + "..."; + this->DisplayOutputs(std::string()); } else { this->Outputs.emplace_back(msg); + this->DisplayOutputs(msg); } - - this->DisplayOutputs(); } int cmCursesMainForm::Configure(int noconfigure) @@ -590,7 +590,7 @@ void cmCursesMainForm::AddError(const std::string& message, { this->Outputs.emplace_back(message); this->HasNonStatusOutputs = true; - this->DisplayOutputs(); + this->DisplayOutputs(message); } void cmCursesMainForm::RemoveEntry(const char* value) @@ -996,18 +996,22 @@ void cmCursesMainForm::ResetOutputs() this->LastProgress.clear(); } -void cmCursesMainForm::DisplayOutputs() +void cmCursesMainForm::DisplayOutputs(std::string const& newOutput) { int xi; int yi; getmaxyx(stdscr, yi, xi); - auto newLogForm = new cmCursesLongMessageForm( - this->Outputs, this->LastProgress.c_str(), - cmCursesLongMessageForm::ScrollBehavior::ScrollDown); - CurrentForm = newLogForm; - this->LogForm.reset(newLogForm); - this->LogForm->Render(1, 1, xi, yi); + if (CurrentForm != this->LogForm.get()) { + auto newLogForm = new cmCursesLongMessageForm( + this->Outputs, this->LastProgress.c_str(), + cmCursesLongMessageForm::ScrollBehavior::ScrollDown); + CurrentForm = newLogForm; + this->LogForm.reset(newLogForm); + this->LogForm->Render(1, 1, xi, yi); + } else { + this->LogForm->UpdateContent(newOutput, this->LastProgress); + } } const char* cmCursesMainForm::s_ConstHelpMessage = diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index b7c204d64e..2e06b90a1c 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -129,7 +129,7 @@ protected: void ResetOutputs(); // Display the current progress and output - void DisplayOutputs(); + void DisplayOutputs(std::string const& newOutput); // Copies of cache entries stored in the user interface std::vector<cmCursesCacheEntryComposite> Entries; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index a49a7f8b40..f5ca5f4542 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -131,6 +131,28 @@ cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg, cmMakefile* makefile) this->LinkerSysroot = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT"); } + if (std::string const* appleArchSysroots = + this->Makefile->GetDef("CMAKE_APPLE_ARCH_SYSROOTS")) { + std::string const& appleArchs = + this->Makefile->GetSafeDefinition("CMAKE_OSX_ARCHITECTURES"); + std::vector<std::string> archs; + std::vector<std::string> sysroots; + cmExpandList(appleArchs, archs); + cmExpandList(*appleArchSysroots, sysroots, true); + if (archs.size() == sysroots.size()) { + for (size_t i = 0; i < archs.size(); ++i) { + this->AppleArchSysroots[archs[i]] = sysroots[i]; + } + } else { + std::string const e = + cmStrCat("CMAKE_APPLE_ARCH_SYSROOTS:\n ", *appleArchSysroots, + "\n" + "is not the same length as CMAKE_OSX_ARCHITECTURES:\n ", + appleArchs); + this->IssueMessage(MessageType::FATAL_ERROR, e); + } + } + for (std::string const& lang : enabledLanguages) { if (lang == "NONE") { continue; @@ -1868,21 +1890,16 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags, std::string("CMAKE_") + lang + "_SYSROOT_FLAG"; const char* sysrootFlag = this->Makefile->GetDefinition(sysrootFlagVar); if (sysrootFlag && *sysrootFlag) { - std::vector<std::string> arch_sysroots; - if (const char* arch_sysroots_str = - this->Makefile->GetDefinition("CMAKE_APPLE_ARCH_SYSROOTS")) { - cmExpandList(std::string(arch_sysroots_str), arch_sysroots, true); - } - if (!arch_sysroots.empty()) { - assert(arch_sysroots.size() == archs.size()); - for (size_t i = 0; i < archs.size(); ++i) { - if (arch_sysroots[i].empty()) { + if (!this->AppleArchSysroots.empty()) { + for (std::string const& arch : archs) { + std::string const& archSysroot = this->AppleArchSysroots[arch]; + if (cmIsOff(archSysroot)) { continue; } - if (filterArch.empty() || filterArch == archs[i]) { - flags += " -Xarch_" + archs[i] + " "; + if (filterArch.empty() || filterArch == arch) { + flags += " -Xarch_" + arch + " "; // Combine sysroot flag and path to work with -Xarch - std::string arch_sysroot = sysrootFlag + arch_sysroots[i]; + std::string arch_sysroot = sysrootFlag + archSysroot; flags += this->ConvertToOutputFormat(arch_sysroot, SHELL); } } diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 25ed2655b5..71cc63eeab 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -514,6 +514,7 @@ protected: std::map<std::string, std::string> VariableMappings; std::string CompilerSysroot; std::string LinkerSysroot; + std::unordered_map<std::string, std::string> AppleArchSysroots; bool EmitUniversalBinaryFlags; diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 880b2d2c3d..8ec3058097 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -3010,7 +3010,11 @@ bool SystemTools::FileIsDirectory(const std::string& inName) bool SystemTools::FileIsExecutable(const std::string& name) { +#if defined(_WIN32) + return SystemTools::FileExists(name, true); +#else return !FileIsDirectory(name) && TestFileAccess(name, TEST_FILE_EXECUTE); +#endif } bool SystemTools::FileIsSymlink(const std::string& name) |