[gtk-doc/win-no-msys: 2/8] 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: 2/8] build: Use /utf-8 for MSVC if possible
- Date: Wed, 15 Apr 2020 04:05:13 +0000 (UTC)
commit 9f2dfd259e9cb28ea178ade163360de2be1a09ba
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 e821e35..1ac68cb 100644
--- a/meson.build
+++ b/meson.build
@@ -163,6 +163,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 aa1d4e4..155f5af 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]