[gtk-doc/win-no-msys: 13/21] build: Use /utf-8 for MSVC if possible
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc/win-no-msys: 13/21] build: Use /utf-8 for MSVC if possible
- Date: Mon, 7 Sep 2020 09:50:04 +0000 (UTC)
commit 059e2eca166872c4b38f4a6a67dedb78269ab2f7
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Tue Apr 14 12:04:54 2020 +0800
build: Use /utf-8 for MSVC if possible
This avoids seeing C4819 warnings/errors that may be triggered if building on
an East Asian locale of Windows, as we do in most of the GTK stack.
Also use /FImsvc_recommended_pragmas.h so that we are more careful about how
the builds are done by filtering out the harmless warnings and flagging down
the ones that really matter.
meson.build | 1 +
tests/gobject/src/meson.build | 7 +++++++
2 files changed, 8 insertions(+)
---
diff --git a/meson.build b/meson.build
index 0345989d..fd31d4a3 100644
--- a/meson.build
+++ b/meson.build
@@ -168,6 +168,7 @@ configure_file(
subdir('help')
if get_option('tests')
+ cc = meson.get_compiler('c')
subdir('tests')
endif
diff --git a/tests/gobject/src/meson.build b/tests/gobject/src/meson.build
index aa1d4e4f..155f5af2 100644
--- a/tests/gobject/src/meson.build
+++ b/tests/gobject/src/meson.build
@@ -15,10 +15,17 @@ gobject_test_deps = [
gobject_dep,
]
+extra_cflags = []
+if cc.get_id() == 'msvc'
+ extra_cflags += '/FImsvc_recommended_pragmas.h'
+ extra_cflags += cc.get_supported_arguments(['/utf-8'])
+endif
+
gobject_test_lib = shared_library(
'gobjecttester',
sources: gobject_test_c,
dependencies: gobject_test_deps,
+ c_args: extra_cflags,
install: false,
)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]