aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author司徒玟琅 <sanjusss@qq.com>2020-08-13 01:07:44 +0800
committerGitHub <noreply@github.com>2020-08-12 13:07:44 -0400
commit3fc580ec4a580c1e57ae09cf6d19f23bdb40e01c (patch)
tree4afa7ee5e491cdd0cc032c27912f01839b11e744
parente208100fc9ef14e775927ccb99e934b2007e671f (diff)
downloadlibuv-3fc580ec4a580c1e57ae09cf6d19f23bdb40e01c.tar.gz
libuv-3fc580ec4a580c1e57ae09cf6d19f23bdb40e01c.zip
cmake: fix compile error C2001 on Chinese Windows
Fixes: https://github.com/libuv/libuv/issues/2887 PR-URL: https://github.com/libuv/libuv/pull/2889 Reviewed-By: Jameson Nash <vtjnash@gmail.com>
-rw-r--r--CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e7f78879..3c735aec 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -56,6 +56,8 @@ check_c_compiler_flag(-Wno-unused-parameter UV_LINT_NO_UNUSED_PARAMETER)
check_c_compiler_flag(-Wstrict-prototypes UV_LINT_STRICT_PROTOTYPES)
check_c_compiler_flag(-Wextra UV_LINT_EXTRA)
+check_c_compiler_flag(/utf-8 UV_LINT_UTF8_MSVC)
+
set(lint-no-unused-parameter $<$<BOOL:${UV_LINT_NO_UNUSED_PARAMETER}>:-Wno-unused-parameter>)
set(lint-strict-prototypes $<$<BOOL:${UV_LINT_STRICT_PROTOTYPES}>:-Wstrict-prototypes>)
set(lint-extra $<$<BOOL:${UV_LINT_EXTRA}>:-Wextra>)
@@ -76,6 +78,7 @@ set(lint-no-unsafe-msvc $<$<BOOL:${UV_LINT_NO_UNSAFE_MSVC}>:/wd4996>)
string(CONCAT lint-default $<
$<AND:$<BOOL:${UV_LINT_WALL}>,$<NOT:${is-msvc}>>:-Wall
>)
+set(lint-utf8-msvc $<$<BOOL:${UV_LINT_UTF8_MSVC}>:/utf-8>)
list(APPEND uv_cflags ${lint-strict-prototypes} ${lint-extra} ${lint-default} ${lint-w4})
list(APPEND uv_cflags ${lint-no-unused-parameter})
@@ -90,6 +93,7 @@ list(APPEND uv_cflags ${lint-no-hides-param-msvc})
list(APPEND uv_cflags ${lint-no-hides-global-msvc})
list(APPEND uv_cflags ${lint-no-conditional-assignment-msvc})
list(APPEND uv_cflags ${lint-no-unsafe-msvc})
+list(APPEND uv_cflags ${lint-utf8-msvc} )
set(uv_sources
src/fs-poll.c