From 2f1a8a8eaba8eac7b6feb9acf6b26e66dba0eb58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=88=B1=E7=8E=A9=E8=80=8D=E7=9A=84=E5=92=B8=E9=B1=BC=28h?= =?UTF-8?q?appyxianyu=29?= <57778195+happyxianyu@users.noreply.github.com> Date: Sat, 25 Jun 2022 19:58:26 -0400 Subject: [PATCH] fix utfcpp test failed on windows (#1303) --- packages/u/utfcpp/xmake.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/u/utfcpp/xmake.lua b/packages/u/utfcpp/xmake.lua index 7e6921ee5..cf20b997b 100644 --- a/packages/u/utfcpp/xmake.lua +++ b/packages/u/utfcpp/xmake.lua @@ -18,7 +18,7 @@ package("utfcpp") end) on_test(function (package) - assert(package:check_cxxsnippets({test = [[ + local test_snippet = [[ #define UTF_CPP_CPLUSPLUS 201103L #include void test() { @@ -26,5 +26,11 @@ package("utfcpp") std::u16string u16line = utf8::utf8to16(line); std::string u8line = utf8::utf16to8(u16line); } - ]]}, {configs = {languages = "c++11"}})) + ]] + + if package:is_plat("windows") then + assert(package:check_cxxsnippets({test = test_snippet}, {configs = {languages = "c++11", cxflags = "/utf-8"}})) + else + assert(package:check_cxxsnippets({test = test_snippet}, {configs = {languages = "c++11"}})) + end end)