This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  a2319c04f6c6b881b2cd37ec33378c4781f415e1 (commit)
       via  af75ab7645545bc046d18c8af48f3198a9de4080 (commit)
       via  0db458a0ce7d5dce245d7489c852c3ba2367aa5d (commit)
       via  0328b64efdf102206e855d16cd9b765f268c6bc9 (commit)
       via  b821f9ad62d97b975255380674aaedfce296a8b8 (commit)
      from  8212b0880d4b481496306535b58adcd9121fd71b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a2319c04f6c6b881b2cd37ec33378c4781f415e1
commit a2319c04f6c6b881b2cd37ec33378c4781f415e1
Merge: 8212b08 af75ab7
Author:     Craig Scott <craig.sc...@crascit.com>
AuthorDate: Sat Jul 13 00:25:50 2019 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Fri Jul 12 20:26:12 2019 -0400

    Merge topic 'cleanup-statics-stream-flush'
    
    af75ab7645 Refactor: Use anonymous namespace instead of `static`s in 
`cpack.cxx`
    0db458a0ce Refactor: Use anonymous namespace instead of `static`s
    0328b64efd Refactor: Remove one-time used macros
    b821f9ad62 Refactor: Optimize some stream output operations
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !3535


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=af75ab7645545bc046d18c8af48f3198a9de4080
commit af75ab7645545bc046d18c8af48f3198a9de4080
Author:     Alex Turbov <i.za...@gmail.com>
AuthorDate: Thu Jul 4 23:05:24 2019 +0300
Commit:     Alex Turbov <i.za...@gmail.com>
CommitDate: Wed Jul 10 01:07:18 2019 +0300

    Refactor: Use anonymous namespace instead of `static`s in `cpack.cxx`
    
    Signed-off-by: Alex Turbov <i.za...@gmail.com>

diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 58b9e70..3edcbaf 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -29,19 +29,20 @@
 #include "cmSystemTools.h"
 #include "cmake.h"
 
-static const char* cmDocumentationName[][2] = {
+namespace {
+const char* cmDocumentationName[][2] = {
   { nullptr, "  cpack - Packaging driver provided by CMake." },
   { nullptr, nullptr }
 };
 
-static const char* cmDocumentationUsage[][2] = {
+const char* cmDocumentationUsage[][2] = {
   // clang-format off
   { nullptr, "  cpack [options]" },
   { nullptr, nullptr }
   // clang-format on
 };
 
-static const char* cmDocumentationOptions[][2] = {
+const char* cmDocumentationOptions[][2] = {
   { "-G <generators>", "Override/define CPACK_GENERATOR" },
   { "-C <Configuration>", "Specify the project configuration" },
   { "-D <var>=<value>", "Set a CPack variable." },
@@ -90,10 +91,11 @@ int cpackDefinitionArgument(const char* argument, const 
char* cValue,
   return 1;
 }
 
-static void cpackProgressCallback(const std::string& message, float /*unused*/)
+void cpackProgressCallback(const std::string& message, float /*unused*/)
 {
   std::cout << "-- " << message << std::endl;
 }
+} // namespace
 
 // this is CPack.
 int main(int argc, char const* const* argv)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0db458a0ce7d5dce245d7489c852c3ba2367aa5d
commit 0db458a0ce7d5dce245d7489c852c3ba2367aa5d
Author:     Alex Turbov <i.za...@gmail.com>
AuthorDate: Thu Jul 4 22:48:43 2019 +0300
Commit:     Alex Turbov <i.za...@gmail.com>
CommitDate: Wed Jul 10 01:06:58 2019 +0300

    Refactor: Use anonymous namespace instead of `static`s
    
    Signed-off-by: Alex Turbov <i.za...@gmail.com>

diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 4f088a8..cfb3cee 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -31,13 +31,14 @@
 #include <string>
 #include <vector>
 
+namespace {
 #ifdef CMAKE_BUILD_WITH_CMAKE
-static const char* cmDocumentationName[][2] = {
+const char* cmDocumentationName[][2] = {
   { nullptr, "  cmake - Cross-Platform Makefile Generator." },
   { nullptr, nullptr }
 };
 
-static const char* cmDocumentationUsage[][2] = {
+const char* cmDocumentationUsage[][2] = {
   { nullptr,
     "  cmake [options] <path-to-source>\n"
     "  cmake [options] <path-to-existing-build>\n"
@@ -49,12 +50,12 @@ static const char* cmDocumentationUsage[][2] = {
   { nullptr, nullptr }
 };
 
-static const char* cmDocumentationUsageNote[][2] = {
+const char* cmDocumentationUsageNote[][2] = {
   { nullptr, "Run 'cmake --help' for more information." },
   { nullptr, nullptr }
 };
 
-static const char* cmDocumentationOptions[][2] = {
+const char* cmDocumentationOptions[][2] = {
   CMAKE_STANDARD_OPTIONS_TABLE,
   { "-E", "CMake command mode." },
   { "-L[A][H]", "List non-advanced cached variables." },
@@ -89,7 +90,7 @@ static const char* cmDocumentationOptions[][2] = {
 
 #endif
 
-static int do_command(int ac, char const* const* av)
+int do_command(int ac, char const* const* av)
 {
   std::vector<std::string> args;
   args.reserve(ac - 1);
@@ -98,12 +99,7 @@ static int do_command(int ac, char const* const* av)
   return cmcmd::ExecuteCMakeCommand(args);
 }
 
-int do_cmake(int ac, char const* const* av);
-static int do_build(int ac, char const* const* av);
-static int do_install(int ac, char const* const* av);
-static int do_open(int ac, char const* const* av);
-
-static cmMakefile* cmakemainGetMakefile(cmake* cm)
+cmMakefile* cmakemainGetMakefile(cmake* cm)
 {
   if (cm && cm->GetDebugOutput()) {
     cmGlobalGenerator* gg = cm->GetGlobalGenerator();
@@ -114,7 +110,7 @@ static cmMakefile* cmakemainGetMakefile(cmake* cm)
   return nullptr;
 }
 
-static std::string cmakemainGetStack(cmake* cm)
+std::string cmakemainGetStack(cmake* cm)
 {
   std::string msg;
   cmMakefile* mf = cmakemainGetMakefile(cm);
@@ -128,14 +124,13 @@ static std::string cmakemainGetStack(cmake* cm)
   return msg;
 }
 
-static void cmakemainMessageCallback(const std::string& m,
-                                     const char* /*unused*/, cmake* cm)
+void cmakemainMessageCallback(const std::string& m, const char* /*unused*/,
+                              cmake* cm)
 {
   std::cerr << m << cmakemainGetStack(cm) << std::endl;
 }
 
-static void cmakemainProgressCallback(const std::string& m, float prog,
-                                      cmake* cm)
+void cmakemainProgressCallback(const std::string& m, float prog, cmake* cm)
 {
   cmMakefile* mf = cmakemainGetMakefile(cm);
   std::string dir;
@@ -152,46 +147,6 @@ static void cmakemainProgressCallback(const std::string& 
m, float prog,
   }
 }
 
-int main(int ac, char const* const* av)
-{
-  cmSystemTools::EnsureStdPipes();
-#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);
-  ac = args.argc();
-  av = args.argv();
-
-  cmSystemTools::EnableMSVCDebugHook();
-  cmSystemTools::InitializeLibUV();
-  cmSystemTools::FindCMakeResources(av[0]);
-  if (ac > 1) {
-    if (strcmp(av[1], "--build") == 0) {
-      return do_build(ac, av);
-    }
-    if (strcmp(av[1], "--install") == 0) {
-      return do_install(ac, av);
-    }
-    if (strcmp(av[1], "--open") == 0) {
-      return do_open(ac, av);
-    }
-    if (strcmp(av[1], "-E") == 0) {
-      return do_command(ac, av);
-    }
-  }
-  int ret = do_cmake(ac, av);
-#ifdef CMAKE_BUILD_WITH_CMAKE
-  cmDynamicLoader::FlushCache();
-#endif
-  uv_loop_close(uv_default_loop());
-  return ret;
-}
-
 int do_cmake(int ac, char const* const* av)
 {
   if (cmSystemTools::GetCurrentWorkingDirectory().empty()) {
@@ -351,7 +306,6 @@ int do_cmake(int ac, char const* const* av)
   return 0;
 }
 
-namespace {
 int extract_job_number(int& index, char const* current, char const* next,
                        int len_of_flag)
 {
@@ -381,9 +335,8 @@ int extract_job_number(int& index, char const* current, 
char const* next,
   }
   return jobs;
 }
-}
 
-static int do_build(int ac, char const* const* av)
+int do_build(int ac, char const* const* av)
 {
 #ifndef CMAKE_BUILD_WITH_CMAKE
   std::cerr << "This cmake does not support --build\n";
@@ -547,7 +500,7 @@ static int do_build(int ac, char const* const* av)
 #endif
 }
 
-static int do_install(int ac, char const* const* av)
+int do_install(int ac, char const* const* av)
 {
 #ifndef CMAKE_BUILD_WITH_CMAKE
   std::cerr << "This cmake does not support --install\n";
@@ -668,7 +621,7 @@ static int do_install(int ac, char const* const* av)
 #endif
 }
 
-static int do_open(int ac, char const* const* av)
+int do_open(int ac, char const* const* av)
 {
 #ifndef CMAKE_BUILD_WITH_CMAKE
   std::cerr << "This cmake does not support --open\n";
@@ -710,3 +663,44 @@ static int do_open(int ac, char const* const* av)
   return cm.Open(dir, false) ? 0 : 1;
 #endif
 }
+} // namespace
+
+int main(int ac, char const* const* av)
+{
+  cmSystemTools::EnsureStdPipes();
+#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);
+  ac = args.argc();
+  av = args.argv();
+
+  cmSystemTools::EnableMSVCDebugHook();
+  cmSystemTools::InitializeLibUV();
+  cmSystemTools::FindCMakeResources(av[0]);
+  if (ac > 1) {
+    if (strcmp(av[1], "--build") == 0) {
+      return do_build(ac, av);
+    }
+    if (strcmp(av[1], "--install") == 0) {
+      return do_install(ac, av);
+    }
+    if (strcmp(av[1], "--open") == 0) {
+      return do_open(ac, av);
+    }
+    if (strcmp(av[1], "-E") == 0) {
+      return do_command(ac, av);
+    }
+  }
+  int ret = do_cmake(ac, av);
+#ifdef CMAKE_BUILD_WITH_CMAKE
+  cmDynamicLoader::FlushCache();
+#endif
+  uv_loop_close(uv_default_loop());
+  return ret;
+}

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0328b64efdf102206e855d16cd9b765f268c6bc9
commit 0328b64efdf102206e855d16cd9b765f268c6bc9
Author:     Alex Turbov <i.za...@gmail.com>
AuthorDate: Thu Jul 4 22:44:44 2019 +0300
Commit:     Alex Turbov <i.za...@gmail.com>
CommitDate: Wed Jul 10 01:06:26 2019 +0300

    Refactor: Remove one-time used macros
    
    Signed-off-by: Alex Turbov <i.za...@gmail.com>

diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index f80829f..4f088a8 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -54,34 +54,6 @@ static const char* cmDocumentationUsageNote[][2] = {
   { nullptr, nullptr }
 };
 
-#  define CMAKE_BUILD_OPTIONS                                                 \
-    "  <dir>          = Project binary directory to be built.\n"              \
-    "  --parallel [<jobs>], -j [<jobs>]\n"                                    \
-    "                 = Build in parallel using the given number of jobs. \n" \
-    "                   If <jobs> is omitted the native build tool's \n"      \
-    "                   default number is used.\n"                            \
-    "                   The CMAKE_BUILD_PARALLEL_LEVEL environment "          \
-    "variable\n"                                                              \
-    "                   specifies a default parallel level when this "        \
-    "option\n"                                                                \
-    "                   is not given.\n"                                      \
-    "  --target <tgt>..., -t <tgt>... \n"                                     \
-    "                 = Build <tgt> instead of default targets.\n"            \
-    "  --config <cfg> = For multi-configuration tools, choose <cfg>.\n"       \
-    "  --clean-first  = Build target 'clean' first, then build.\n"            \
-    "                   (To clean only, use --target 'clean'.)\n"             \
-    "  --verbose, -v  = Enable verbose output - if supported - including\n"   \
-    "                   the build commands to be executed. \n"                \
-    "  --             = Pass remaining options to the native tool.\n"
-
-#  define CMAKE_INSTALL_OPTIONS                                               \
-    "  <dir>              = Project binary directory to install.\n"           \
-    "  --config <cfg>     = For multi-configuration tools, choose <cfg>.\n"   \
-    "  --component <comp> = Component-based install. Only install <comp>.\n"  \
-    "  --prefix <prefix>  = The installation prefix CMAKE_INSTALL_PREFIX.\n"  \
-    "  --strip            = Performing install/strip.\n"                      \
-    "  -v --verbose       = Enable verbose output.\n"
-
 static const char* cmDocumentationOptions[][2] = {
   CMAKE_STANDARD_OPTIONS_TABLE,
   { "-E", "CMake command mode." },
@@ -539,7 +511,24 @@ static int do_build(int ac, char const* const* av)
     std::cerr <<
       "Usage: cmake --build <dir> [options] [-- [native-options]]\n"
       "Options:\n"
-      CMAKE_BUILD_OPTIONS
+      "  <dir>          = Project binary directory to be built.\n"
+      "  --parallel [<jobs>], -j [<jobs>]\n"
+      "                 = Build in parallel using the given number of jobs. \n"
+      "                   If <jobs> is omitted the native build tool's \n"
+      "                   default number is used.\n"
+      "                   The CMAKE_BUILD_PARALLEL_LEVEL environment "
+      "variable\n"
+      "                   specifies a default parallel level when this "
+      "option\n"
+      "                   is not given.\n"
+      "  --target <tgt>..., -t <tgt>... \n"
+      "                 = Build <tgt> instead of default targets.\n"
+      "  --config <cfg> = For multi-configuration tools, choose <cfg>.\n"
+      "  --clean-first  = Build target 'clean' first, then build.\n"
+      "                   (To clean only, use --target 'clean'.)\n"
+      "  --verbose, -v  = Enable verbose output - if supported - including\n"
+      "                   the build commands to be executed. \n"
+      "  --             = Pass remaining options to the native tool.\n"
       ;
     /* clang-format on */
     return 1;
@@ -625,8 +614,18 @@ static int do_install(int ac, char const* const* av)
   }
 
   if (dir.empty()) {
-    std::cerr << "Usage: cmake --install <dir> "
-                 "[options]\nOptions:\n" CMAKE_INSTALL_OPTIONS;
+    /* clang-format off */
+    std::cerr <<
+      "Usage: cmake --install <dir> [options]\n"
+      "Options:\n"
+      "  <dir>              = Project binary directory to install.\n"
+      "  --config <cfg>     = For multi-configuration tools, choose <cfg>.\n"
+      "  --component <comp> = Component-based install. Only install <comp>.\n"
+      "  --prefix <prefix>  = The installation prefix CMAKE_INSTALL_PREFIX.\n"
+      "  --strip            = Performing install/strip.\n"
+      "  -v --verbose       = Enable verbose output.\n"
+      ;
+    /* clang-format on */
     return 1;
   }
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b821f9ad62d97b975255380674aaedfce296a8b8
commit b821f9ad62d97b975255380674aaedfce296a8b8
Author:     Alex Turbov <i.za...@gmail.com>
AuthorDate: Thu Jul 4 21:04:19 2019 +0300
Commit:     Alex Turbov <i.za...@gmail.com>
CommitDate: Wed Jul 10 01:06:14 2019 +0300

    Refactor: Optimize some stream output operations
    
    - remove redundant `std::flush` right after `std::endl`
    - join some string literals
    
    Signed-off-by: Alex Turbov <i.za...@gmail.com>

diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index d1226c3..63b8da4 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1098,9 +1098,10 @@ int cmCTest::RunMakeCommand(const std::string& command, 
std::string& output,
   cmProcessOutput processOutput(encoding);
   std::string strdata;
   cmCTestLog(this, HANDLER_PROGRESS_OUTPUT,
-             "   Each . represents " << tick_len << " bytes of output"
-                                     << std::endl
-                                     << "    " << std::flush);
+             "   Each . represents " << tick_len
+                                     << " bytes of output\n"
+                                        "    "
+                                     << std::flush);
   while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) {
     processOutput.DecodeText(data, length, strdata);
     for (char& cc : strdata) {
@@ -1115,8 +1116,7 @@ int cmCTest::RunMakeCommand(const std::string& command, 
std::string& output,
       if (tick % tick_line_len == 0 && tick > 0) {
         cmCTestLog(this, HANDLER_PROGRESS_OUTPUT,
                    "  Size: " << int((double(output.size()) / 1024.0) + 1)
-                              << "K" << std::endl
-                              << "    " << std::flush);
+                              << "K\n    " << std::flush);
       }
     }
     cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
@@ -1324,18 +1324,14 @@ int cmCTest::RunTest(std::vector<const char*> argv, 
std::string* output,
     if (output) {
       *output += outerr;
     }
-    cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
-               outerr << std::endl
-                      << std::flush);
+    cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr << std::endl);
   } else if (result == cmsysProcess_State_Error) {
     std::string outerr = "\n*** ERROR executing: ";
     outerr += cmsysProcess_GetErrorString(cp);
     if (output) {
       *output += outerr;
     }
-    cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
-               outerr << std::endl
-                      << std::flush);
+    cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr << std::endl);
   }
   cmsysProcess_Delete(cp);
 
@@ -3077,11 +3073,11 @@ void cmCTest::Log(int logType, const char* file, int 
line, const char* msg,
         } else {
           *this->Impl->OutputLogFile << cmCTestStringLogType[logType];
         }
-        *this->Impl->OutputLogFile << "] " << std::endl << std::flush;
+        *this->Impl->OutputLogFile << "] " << std::endl;
       }
       *this->Impl->OutputLogFile << msg << std::flush;
       if (logType != this->Impl->OutputLogFileLastTag) {
-        *this->Impl->OutputLogFile << std::endl << std::flush;
+        *this->Impl->OutputLogFile << std::endl;
         this->Impl->OutputLogFileLastTag = logType;
       }
     }
@@ -3194,7 +3190,7 @@ void cmCTest::OutputTestErrors(std::vector<char> const& 
process_output)
   if (!process_output.empty()) {
     test_outputs.append(process_output.data(), process_output.size());
   }
-  cmCTestLog(this, HANDLER_OUTPUT, test_outputs << std::endl << std::flush);
+  cmCTestLog(this, HANDLER_OUTPUT, test_outputs << std::endl);
 }
 
 bool cmCTest::CompressString(std::string& str)
diff --git a/Source/cmMessenger.cxx b/Source/cmMessenger.cxx
index 1d790e2..0d2b21f 100644
--- a/Source/cmMessenger.cxx
+++ b/Source/cmMessenger.cxx
@@ -100,8 +100,7 @@ void displayMessage(MessageType t, std::ostringstream& msg)
            "it.";
   } else if (t == MessageType::AUTHOR_ERROR) {
     msg << "This error is for project developers. Use -Wno-error=dev to "
-           "suppress "
-           "it.";
+           "suppress it.";
   }
 
   // Add a terminating blank line.
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index a6348b3..f80829f 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -159,7 +159,7 @@ static std::string cmakemainGetStack(cmake* cm)
 static void cmakemainMessageCallback(const std::string& m,
                                      const char* /*unused*/, cmake* cm)
 {
-  std::cerr << m << cmakemainGetStack(cm) << std::endl << std::flush;
+  std::cerr << m << cmakemainGetStack(cm) << std::endl;
 }
 
 static void cmakemainProgressCallback(const std::string& m, float prog,
@@ -178,8 +178,6 @@ static void cmakemainProgressCallback(const std::string& m, 
float prog,
   if ((prog < 0) || (!dir.empty())) {
     std::cout << "-- " << m << dir << cmakemainGetStack(cm) << std::endl;
   }
-
-  std::cout.flush();
 }
 
 int main(int ac, char const* const* av)

-----------------------------------------------------------------------

Summary of changes:
 Source/CPack/cpack.cxx |  10 +--
 Source/cmCTest.cxx     |  24 +++----
 Source/cmMessenger.cxx |   3 +-
 Source/cmakemain.cxx   | 181 +++++++++++++++++++++++--------------------------
 4 files changed, 103 insertions(+), 115 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits

Reply via email to