summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/cpack.cxx2
-rw-r--r--Source/cmSystemTools.cxx10
-rw-r--r--Source/cmSystemTools.h3
-rw-r--r--Source/cmakemain.cxx4
4 files changed, 16 insertions, 3 deletions
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 2e5bde2..3a400b7 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -312,7 +312,7 @@ int main(int argc, char const* const* argv)
// The value has not been set on the command line
else {
// get a default value (current working directory)
- cpackProjectDirectory = cmsys::SystemTools::GetCurrentWorkingDirectory();
+ cpackProjectDirectory = cmSystemTools::GetCurrentWorkingDirectory();
// use default value if no value has been provided by the config file
if (!globalMF.IsSet("CPACK_PACKAGE_DIRECTORY")) {
globalMF.AddDefinition("CPACK_PACKAGE_DIRECTORY",
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index be799b0..1e78d36 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -823,7 +823,9 @@ void cmSystemTools::InitializeLibUV()
// 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());
+ if (uv_loop_t* loop = uv_default_loop()) {
+ uv_loop_close(loop);
+ }
# ifdef _MSC_VER
_set_fmode(_O_TEXT);
# else
@@ -2080,6 +2082,12 @@ std::string const& cmSystemTools::GetCMakeRoot()
return cmSystemToolsCMakeRoot;
}
+std::string cmSystemTools::GetCurrentWorkingDirectory()
+{
+ return cmSystemTools::CollapseFullPath(
+ cmsys::SystemTools::GetCurrentWorkingDirectory());
+}
+
void cmSystemTools::MakefileColorEcho(int color, const char* message,
bool newline, bool enabled)
{
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index ee149a0..b886c58 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -390,6 +390,9 @@ public:
static std::string const& GetCMClDepsCommand();
static std::string const& GetCMakeRoot();
+ /** Get the CWD mapped through the KWSys translation map. */
+ static std::string GetCurrentWorkingDirectory();
+
/** Echo a message in color using KWSys's Terminal cprintf. */
static void MakefileColorEcho(int color, const char* message, bool newLine,
bool enabled);
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 75280fb..e0c17f8 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -717,6 +717,8 @@ int main(int ac, char const* const* av)
#ifndef CMAKE_BOOTSTRAP
cmDynamicLoader::FlushCache();
#endif
- uv_loop_close(uv_default_loop());
+ if (uv_loop_t* loop = uv_default_loop()) {
+ uv_loop_close(loop);
+ }
return ret;
}