[Cmake-commits] CMake branch, master, updated. v3.10.2-884-g06d6072

Kitware Robot kwrobot at kitware.com
Wed Jan 24 08:45:06 EST 2018


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  06d607271ed73c2540647c6d257f8deacd86ecae (commit)
       via  98628de812c4724fb2da199abb5fe08eeb5a1a64 (commit)
       via  3b588ac58256540e6dc974cf2d1a122c95f19171 (commit)
      from  1345bdf1b6520a2f0c9891ad3c6fee00a6a5f18d (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=06d607271ed73c2540647c6d257f8deacd86ecae
commit 06d607271ed73c2540647c6d257f8deacd86ecae
Merge: 1345bdf 98628de
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 24 13:36:28 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Jan 24 08:36:35 2018 -0500

    Merge topic 'libuv-restore-fmode'
    
    98628de8 Extend libuv file translate mode workaround to all executables
    3b588ac5 cpack: Enable MSVC debug hook earlier
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1686


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=98628de812c4724fb2da199abb5fe08eeb5a1a64
commit 98628de812c4724fb2da199abb5fe08eeb5a1a64
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 23 08:55:58 2018 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Jan 23 09:29:07 2018 -0500

    Extend libuv file translate mode workaround to all executables
    
    Since libuv commit v1.14.1~7 (win: add uv__once_init() calls,
    2017-08-30) the libuv initialization of the file translate mode may take
    place even if we do not use a uv loop.  This change was included in our
    libuv update commit f4a26c748b (libuv 2018-01-19).  Therefore use of
    libuv even through `cmSystemTools::GetRealPath` in any executable may
    trigger its file translate mode setting.
    
    Factor out the logic added to `cmake.exe` by commit v3.9.0-rc4~10^2
    (cmake: Fix default file translate mode when using libuv, 2017-06-13)
    and re-use to initialize all executables.
    
    Issue: #16962

diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 2505a33..3e9bce9 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -99,6 +99,7 @@ int main(int argc, char const* const* argv)
   argv = args.argv();
 
   cmSystemTools::EnableMSVCDebugHook();
+  cmSystemTools::InitializeLibUV();
   cmSystemTools::FindCMakeResources(argv[0]);
   cmCPackLog log;
 
diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx
index 97d5579..17cf628 100644
--- a/Source/CursesDialog/ccmake.cxx
+++ b/Source/CursesDialog/ccmake.cxx
@@ -75,6 +75,7 @@ int main(int argc, char const* const* argv)
   argc = encoding_args.argc();
   argv = encoding_args.argv();
 
+  cmSystemTools::InitializeLibUV();
   cmSystemTools::FindCMakeResources(argv[0]);
   cmDocumentation doc;
   doc.addCMakeStandardDocSections();
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index bfd43cf..193f4d3 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -55,6 +55,7 @@ int main(int argc, char** argv)
   int argc2 = encoding_args.argc();
   char const* const* argv2 = encoding_args.argv();
 
+  cmSystemTools::InitializeLibUV();
   cmSystemTools::FindCMakeResources(argv2[0]);
   // check docs first so that X is not need to get docs
   // do docs, if args were given
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index c321236..06b0b3c 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -51,6 +51,8 @@
 // include wincrypt.h after windows.h
 #include <wincrypt.h>
 
+#include <fcntl.h> /* _O_TEXT */
+
 #include "cm_uv.h"
 #else
 #include <sys/time.h>
@@ -980,6 +982,21 @@ std::string cmSystemTools::GetRealPath(const std::string& path,
 }
 #endif
 
+void cmSystemTools::InitializeLibUV()
+{
+#if defined(_WIN32)
+  // Perform libuv one-time initialization now, and then un-do its
+  // global _fmode setting so that using libuv does not change the
+  // default file text/binary mode.  See libuv issue 840.
+  uv_loop_close(uv_default_loop());
+#ifdef _MSC_VER
+  _set_fmode(_O_TEXT);
+#else
+  _fmode = _O_TEXT;
+#endif
+#endif
+}
+
 bool cmSystemTools::RenameFile(const char* oldname, const char* newname)
 {
 #ifdef _WIN32
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index d29ba56..25df1f1 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -503,6 +503,10 @@ public:
   static std::string GetRealPath(const std::string& path,
                                  std::string* errorMessage = 0);
 #endif
+
+  /** Perform one-time initialization of libuv.  */
+  static void InitializeLibUV();
+
 private:
   static bool s_ForceUnixPaths;
   static bool s_RunCommandHideConsole;
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 59b908a..b185a1b 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -16,10 +16,6 @@
 #include "cmDynamicLoader.h"
 #endif
 
-#ifdef _WIN32
-#include <fcntl.h>  /* _O_TEXT */
-#include <stdlib.h> /* _set_fmode, _fmode */
-#endif
 #include "cm_uv.h"
 
 #include "cmsys/Encoding.hxx"
@@ -170,19 +166,8 @@ int main(int ac, char const* const* av)
   ac = args.argc();
   av = args.argv();
 
-#if defined(_WIN32)
-  // Perform libuv one-time initialization now, and then un-do its
-  // global _fmode setting so that using libuv does not change the
-  // default file text/binary mode.  See libuv issue 840.
-  uv_loop_close(uv_default_loop());
-#ifdef _MSC_VER
-  _set_fmode(_O_TEXT);
-#else
-  _fmode = _O_TEXT;
-#endif
-#endif
-
   cmSystemTools::EnableMSVCDebugHook();
+  cmSystemTools::InitializeLibUV();
   cmSystemTools::FindCMakeResources(av[0]);
   if (ac > 1) {
     if (strcmp(av[1], "--build") == 0) {
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index ad5fec0..0a6d1d2 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -137,6 +137,7 @@ int main(int argc, char const* const* argv)
 
   cmSystemTools::DoNotInheritStdPipes();
   cmSystemTools::EnableMSVCDebugHook();
+  cmSystemTools::InitializeLibUV();
   cmSystemTools::FindCMakeResources(argv[0]);
 
   // Dispatch 'ctest --launch' mode directly.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3b588ac58256540e6dc974cf2d1a122c95f19171
commit 3b588ac58256540e6dc974cf2d1a122c95f19171
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 23 09:27:30 2018 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Jan 23 09:27:30 2018 -0500

    cpack: Enable MSVC debug hook earlier
    
    All other executables do this just after console and command-line
    encoding conversion.  Do the same in CPack.

diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index addb54e..2505a33 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -98,6 +98,7 @@ int main(int argc, char const* const* argv)
   argc = args.argc();
   argv = args.argv();
 
+  cmSystemTools::EnableMSVCDebugHook();
   cmSystemTools::FindCMakeResources(argv[0]);
   cmCPackLog log;
 
@@ -106,8 +107,6 @@ int main(int argc, char const* const* argv)
   log.SetOutputPrefix("CPack: ");
   log.SetVerbosePrefix("CPack Verbose: ");
 
-  cmSystemTools::EnableMSVCDebugHook();
-
   if (cmSystemTools::GetCurrentWorkingDirectory().empty()) {
     cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
                 "Current working directory cannot be established."

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

Summary of changes:
 Source/CPack/cpack.cxx         |    4 ++--
 Source/CursesDialog/ccmake.cxx |    1 +
 Source/QtDialog/CMakeSetup.cxx |    1 +
 Source/cmSystemTools.cxx       |   17 +++++++++++++++++
 Source/cmSystemTools.h         |    4 ++++
 Source/cmakemain.cxx           |   17 +----------------
 Source/ctest.cxx               |    1 +
 7 files changed, 27 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list