summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibuv
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmlibuv')
-rw-r--r--Utilities/cmlibuv/CMakeLists.txt28
-rw-r--r--Utilities/cmlibuv/src/unix/process.c4
-rw-r--r--Utilities/cmlibuv/src/win/process.c29
3 files changed, 25 insertions, 36 deletions
diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt
index ad3d433..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
@@ -365,4 +351,8 @@ add_library(cmlibuv STATIC ${uv_sources})
target_link_libraries(cmlibuv ${uv_libraries})
set_property(TARGET cmlibuv PROPERTY COMPILE_DEFINITIONS ${uv_defines})
+if(WIN32 AND CMake_BUILD_PCH)
+ target_precompile_headers(cmlibuv PRIVATE "include/uv.h" "src/win/internal.h")
+endif()
+
install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmlibuv)
diff --git a/Utilities/cmlibuv/src/unix/process.c b/Utilities/cmlibuv/src/unix/process.c
index 0de5c46..30872cf 100644
--- a/Utilities/cmlibuv/src/unix/process.c
+++ b/Utilities/cmlibuv/src/unix/process.c
@@ -75,7 +75,9 @@ extern char **environ;
#endif
#endif
-#if defined(__APPLE__) || \
+#ifdef CMAKE_BOOTSTRAP
+#define UV_USE_SIGCHLD
+#elif defined(__APPLE__) || \
defined(__DragonFly__) || \
defined(__FreeBSD__) || \
defined(__NetBSD__) || \
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;
+ }
}
}