summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2020-01-15 15:27:59 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2020-01-15 15:27:59 +0800
commitc0d5f556851908caba1402fe53504101af80e127 (patch)
treee8fb799b331299cc7bed015246dcc74a0b940a14
parent6d3138fe6b773eaadfe62128de3e5828a4d82cd4 (diff)
downloadgtk+-gtk3.meson.msvc.improvements.tar.gz
meson/MSVC builds: Use -utf-8 where availablegtk3.meson.msvc.improvements
This avoids the build from erroring out on C4819 (Unicode handling issue in Visual Studio compiler), notably when running on CHinese, Japanese and Korean locales.
-rw-r--r--meson.build9
1 files changed, 6 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index 6d6f919fd8..d6162b428e 100644
--- a/meson.build
+++ b/meson.build
@@ -274,9 +274,12 @@ endif
if cc.get_id() == 'msvc'
# Compiler options taken from msvc_recommended_pragmas.h
# in GLib, based on _Win32_Programming_ by Rector and Newcomer
- test_cflags = []
- add_project_arguments('-FImsvc_recommended_pragmas.h', language: 'c')
- add_project_arguments('-D_USE_MATH_DEFINES', language: 'c')
+ test_cflags = [
+ '-FImsvc_recommended_pragmas.h',
+ '-D_USE_MATH_DEFINES',
+ '-utf-8',
+ ]
+ add_project_arguments(cc.get_supported_arguments(test_cflags), language: 'c')
elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
test_cflags = [
'-fno-strict-aliasing',