diff options
author | Brad King <brad.king@kitware.com> | 2018-03-07 06:48:34 -0500 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-03-07 06:48:34 -0500 |
commit | 2c5b4359f80f7e0ef5442784ca55a42b6c2bdd17 (patch) | |
tree | 6c055683d8179cb441ea511530aa8e0f1ddf791b /Source/kwsys | |
parent | 9c1efb614dee294cb3a1077e8a232573f309c605 (diff) | |
parent | 64d4308d8347150d072c2f11f9dd557ccaa1dfb2 (diff) | |
download | cmake-2c5b4359f80f7e0ef5442784ca55a42b6c2bdd17.tar.gz |
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
KWSys 2018-03-07 (2ad561e7)
Diffstat (limited to 'Source/kwsys')
-rw-r--r-- | Source/kwsys/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Source/kwsys/SystemInformation.cxx | 6 | ||||
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 30 | ||||
-rw-r--r-- | Source/kwsys/SystemTools.hxx.in | 1 |
4 files changed, 25 insertions, 16 deletions
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index c0154c8c20..4fc176b37c 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -922,7 +922,7 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS) # Set up include usage requirement IF(COMMAND TARGET_INCLUDE_DIRECTORIES) TARGET_INCLUDE_DIRECTORIES(${KWSYS_TARGET_INTERFACE} INTERFACE - $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>) + $<BUILD_INTERFACE:${KWSYS_HEADER_ROOT}>) IF(KWSYS_INSTALL_INCLUDE_DIR) TARGET_INCLUDE_DIRECTORIES(${KWSYS_TARGET_INTERFACE} INTERFACE $<INSTALL_INTERFACE:${KWSYS_INSTALL_INCLUDE_DIR}>) @@ -976,7 +976,7 @@ IF(KWSYS_ENABLE_C AND KWSYS_C_SRCS) # Set up include usage requirement IF(COMMAND TARGET_INCLUDE_DIRECTORIES) TARGET_INCLUDE_DIRECTORIES(${KWSYS_TARGET_C_INTERFACE} INTERFACE - $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>) + $<BUILD_INTERFACE:${KWSYS_HEADER_ROOT}>) IF(KWSYS_INSTALL_INCLUDE_DIR) TARGET_INCLUDE_DIRECTORIES(${KWSYS_TARGET_C_INTERFACE} INTERFACE $<INSTALL_INTERFACE:${KWSYS_INSTALL_INCLUDE_DIR}>) diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index 7503469a29..2b9d7b1741 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -121,7 +121,11 @@ typedef int siginfo_t; #if defined(KWSYS_SYS_HAS_IFADDRS_H) #include <ifaddrs.h> #include <net/if.h> -#if !defined(__LSB_VERSION__) /* LSB has no getifaddrs */ +#if defined(__LSB_VERSION__) +/* LSB has no getifaddrs */ +#elif defined(__ANDROID_API__) && __ANDROID_API__ < 24 +/* Android has no getifaddrs prior to API 24. */ +#else #define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN #endif #endif diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 38910c8d1e..106afe5070 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -27,7 +27,6 @@ #include <iostream> #include <set> #include <sstream> -#include <utility> #include <vector> // Work-around CMake dependency scanning limitation. This must @@ -3254,7 +3253,7 @@ std::string SystemTools::CollapseFullPath(const std::string& in_path, SystemTools::CheckTranslationPath(newPath); #ifdef _WIN32 - newPath = SystemTools::GetActualCaseForPath(newPath); + newPath = SystemTools::GetActualCaseForPathCached(newPath); SystemTools::ConvertToUnixSlashes(newPath); #endif // Return the reconstructed path. @@ -3342,7 +3341,7 @@ std::string SystemTools::RelativePath(const std::string& local, } #ifdef _WIN32 -static std::pair<std::string, bool> GetCasePathName(std::string const& pathIn) +static std::string GetCasePathName(std::string const& pathIn) { std::string casePath; std::vector<std::string> path_components; @@ -3351,7 +3350,7 @@ static std::pair<std::string, bool> GetCasePathName(std::string const& pathIn) { // Relative paths cannot be converted. casePath = pathIn; - return std::make_pair(casePath, false); + return casePath; } // Start with root component. @@ -3403,7 +3402,7 @@ static std::pair<std::string, bool> GetCasePathName(std::string const& pathIn) casePath += path_components[idx]; } - return std::make_pair(casePath, converting); + return casePath; } #endif @@ -3412,22 +3411,27 @@ std::string SystemTools::GetActualCaseForPath(const std::string& p) #ifndef _WIN32 return p; #else + return GetCasePathName(p); +#endif +} + +#ifdef _WIN32 +std::string SystemTools::GetActualCaseForPathCached(std::string const& p) +{ // Check to see if actual case has already been called // for this path, and the result is stored in the PathCaseMap SystemToolsPathCaseMap::iterator i = SystemTools::PathCaseMap->find(p); if (i != SystemTools::PathCaseMap->end()) { return i->second; } - std::pair<std::string, bool> casePath = GetCasePathName(p); - if (casePath.first.size() > MAX_PATH) { - return casePath.first; - } - if (casePath.second) { - (*SystemTools::PathCaseMap)[p] = casePath.first; + std::string casePath = GetCasePathName(p); + if (casePath.size() > MAX_PATH) { + return casePath; } - return casePath.first; -#endif + (*SystemTools::PathCaseMap)[p] = casePath; + return casePath; } +#endif const char* SystemTools::SplitPathRootComponent(const std::string& p, std::string* root) diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in index 719d45c057..e79e3fcf98 100644 --- a/Source/kwsys/SystemTools.hxx.in +++ b/Source/kwsys/SystemTools.hxx.in @@ -988,6 +988,7 @@ private: */ static SystemToolsTranslationMap* TranslationMap; #ifdef _WIN32 + static std::string GetActualCaseForPathCached(std::string const& path); static SystemToolsPathCaseMap* PathCaseMap; static SystemToolsEnvMap* EnvMap; #endif |