diff options
author | Brad King <brad.king@kitware.com> | 2023-08-19 12:41:06 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-08-19 12:41:07 (GMT) |
commit | a891f7d0bf31817a83879b02f5f2a0fbf6913d6e (patch) | |
tree | 6aa7d5c6e7bca4794f3e66fa14648af6cee1cb8e /Utilities | |
parent | 787a8061b3746d5720d3015a31bad050b3daca9a (diff) | |
parent | eee1dc10bea6d2528a08c4e844d96b1f45cfe2ff (diff) | |
download | CMake-a891f7d0bf31817a83879b02f5f2a0fbf6913d6e.zip CMake-a891f7d0bf31817a83879b02f5f2a0fbf6913d6e.tar.gz CMake-a891f7d0bf31817a83879b02f5f2a0fbf6913d6e.tar.bz2 |
Merge topic 'libuv-tweaks'
eee1dc10be libuv: Compile as C11 on all Solaris versions
d6b4f6dd97 libuv: Remove unused compatibility code for CMake < 3.9
5fb17a1410 libuv: win,spawn: allow %PATH% to be unset
703e3e03c3 libuv: Comment why we cannot update past 1.44.2
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8744
Diffstat (limited to 'Utilities')
-rwxr-xr-x | Utilities/Scripts/update-libuv.bash | 4 | ||||
-rw-r--r-- | Utilities/cmlibuv/CMakeLists.txt | 24 | ||||
-rw-r--r-- | Utilities/cmlibuv/src/win/process.c | 29 |
3 files changed, 22 insertions, 35 deletions
diff --git a/Utilities/Scripts/update-libuv.bash b/Utilities/Scripts/update-libuv.bash index 280c684..1027436 100755 --- a/Utilities/Scripts/update-libuv.bash +++ b/Utilities/Scripts/update-libuv.bash @@ -8,6 +8,10 @@ readonly name="libuv" readonly ownership="libuv upstream <libuv@googlegroups.com>" readonly subtree="Utilities/cmlibuv" readonly repo="https://github.com/libuv/libuv.git" +# We cannot import libuv 1.45 or higher because it has higher +# minimum system requirements than we do: +# - It requires C11 atomics from GCC 4.9+. We support GCC 4.8. +# - It requires Windows 8, we support Windows 7. readonly tag="v1.44.2" readonly shortlog=false readonly paths=" diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt index 9df0c7f..a0b161b 100644 --- a/Utilities/cmlibuv/CMakeLists.txt +++ b/Utilities/cmlibuv/CMakeLists.txt @@ -294,27 +294,13 @@ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") ) list(APPEND uv_defines __EXTENSIONS__ + _XOPEN_SOURCE=600 ) + if(NOT CMAKE_C_STANDARD OR CMAKE_C_STANDARD EQUAL 90) + set(CMAKE_C_STANDARD 11) + endif() if(CMAKE_SYSTEM_VERSION STREQUAL "5.10") - set(CMAKE_C_STANDARD 90) - if(CMAKE_VERSION VERSION_LESS 3.8.20170504 AND CMAKE_C_COMPILER_ID STREQUAL "SunPro" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.14) - # The running version of CMake does not know how to add this flag. - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c90") - endif() - list(APPEND uv_defines - _XOPEN_SOURCE=500 - ) - else() - if(NOT CMAKE_C_STANDARD OR CMAKE_C_STANDARD EQUAL 90) - set(CMAKE_C_STANDARD 11) - endif() - if(CMAKE_VERSION VERSION_LESS 3.8.20170505 AND CMAKE_C_COMPILER_ID STREQUAL "SunPro" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 5.14) - # The running version of CMake does not know how to add this flag. - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -xc99") - endif() - list(APPEND uv_defines - _XOPEN_SOURCE=600 - ) + list(APPEND uv_defines SUNOS_NO_IFADDRS) endif() list(APPEND uv_sources src/unix/no-proctitle.c diff --git a/Utilities/cmlibuv/src/win/process.c b/Utilities/cmlibuv/src/win/process.c index 248b7ea..3b5b2800 100644 --- a/Utilities/cmlibuv/src/win/process.c +++ b/Utilities/cmlibuv/src/win/process.c @@ -394,7 +394,7 @@ static WCHAR* search_path(const WCHAR *file, name_has_ext); while (result == NULL) { - if (*dir_end == L'\0') { + if (dir_end == NULL || *dir_end == L'\0') { break; } @@ -1027,22 +1027,19 @@ int uv_spawn(uv_loop_t* loop, DWORD path_len, r; path_len = GetEnvironmentVariableW(L"PATH", NULL, 0); - if (path_len == 0) { - err = GetLastError(); - goto done; - } - - alloc_path = (WCHAR*) uv__malloc(path_len * sizeof(WCHAR)); - if (alloc_path == NULL) { - err = ERROR_OUTOFMEMORY; - goto done; - } - path = alloc_path; + if (path_len != 0) { + alloc_path = (WCHAR*) uv__malloc(path_len * sizeof(WCHAR)); + if (alloc_path == NULL) { + err = ERROR_OUTOFMEMORY; + goto done; + } + path = alloc_path; - r = GetEnvironmentVariableW(L"PATH", path, path_len); - if (r == 0 || r >= path_len) { - err = GetLastError(); - goto done; + r = GetEnvironmentVariableW(L"PATH", path, path_len); + if (r == 0 || r >= path_len) { + err = GetLastError(); + goto done; + } } } |