mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 06:09:52 -06:00
Merge topic 'libuv-restore-fmode'
98628de8Extend libuv file translate mode workaround to all executables3b588ac5cpack: Enable MSVC debug hook earlier Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1686
This commit is contained in:
@@ -98,6 +98,8 @@ int main(int argc, char const* const* argv)
|
||||
argc = args.argc();
|
||||
argv = args.argv();
|
||||
|
||||
cmSystemTools::EnableMSVCDebugHook();
|
||||
cmSystemTools::InitializeLibUV();
|
||||
cmSystemTools::FindCMakeResources(argv[0]);
|
||||
cmCPackLog log;
|
||||
|
||||
@@ -106,8 +108,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."
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user