[gobject-introspection/msvc-pragmas-stable: 5/5] build: Force-include msvc_recommended_pragmas.h on Visual Studio
- From: Christoph Reiter <creiter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection/msvc-pragmas-stable: 5/5] build: Force-include msvc_recommended_pragmas.h on Visual Studio
- Date: Fri, 3 May 2019 20:53:02 +0000 (UTC)
commit 76396d4c23588fb4f225d3d5977af6c0ff056e71
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Tue Apr 30 16:07:39 2019 +0800
build: Force-include msvc_recommended_pragmas.h on Visual Studio
By doing so, we essentially cover the various compiler flags that we
want to use for non-Visual Studio builds to check for warnings that
might cause real concern.
This also skips the checks for the various GCC-isque CFlag checks that
are scattered in the various build files on Visual Studio builds, since
they are essentially meaningless on Visual Studio builds.
girepository/cmph/meson.build | 38 +++++++++++++++++++++++---------------
girepository/meson.build | 43 +++++++++++++++++++++++++++----------------
giscanner/meson.build | 12 ++++++++----
meson.build | 4 ++++
tests/meson.build | 19 +++++++++++++------
tests/scanner/meson.build | 21 +++++++++++++--------
tools/meson.build | 15 ++++++---------
7 files changed, 94 insertions(+), 58 deletions(-)
---
diff --git a/girepository/cmph/meson.build b/girepository/cmph/meson.build
index d7b1e423..5bc41a33 100644
--- a/girepository/cmph/meson.build
+++ b/girepository/cmph/meson.build
@@ -29,17 +29,22 @@ cmph_deps = [
cc.find_library('m', required: false),
]
-custom_c_args = cc.get_supported_arguments([
- '-Wno-implicit-fallthrough',
- '-Wno-old-style-definition',
- '-Wno-suggest-attribute=noreturn',
- '-Wno-type-limits',
- '-Wno-undef',
- '-Wno-unused-parameter',
- '-Wno-cast-align',
- '-Wno-unused-function',
- '-Wno-return-type',
-])
+custom_c_args = []
+
+if cc.get_id() != 'msvc'
+ custom_c_args = cc.get_supported_arguments([
+ '-Wno-implicit-fallthrough',
+ '-Wno-old-style-definition',
+ '-Wno-suggest-attribute=noreturn',
+ '-Wno-type-limits',
+ '-Wno-undef',
+ '-Wno-unused-parameter',
+ '-Wno-cast-align',
+ '-Wno-unused-function',
+ '-Wno-return-type',
+ ])
+endif
+
cmph = static_library('cmph',
sources: cmph_sources,
c_args: gi_hidden_visibility_cflags + custom_c_args,
@@ -51,10 +56,13 @@ cmph_dep = declare_dependency(
include_directories: include_directories('.'),
)
-custom_c_args = cc.get_supported_arguments([
- '-Wno-old-style-definition',
- '-Wno-type-limits',
-])
+if cc.get_id() != 'msvc'
+ custom_c_args = cc.get_supported_arguments([
+ '-Wno-old-style-definition',
+ '-Wno-type-limits',
+ ])
+endif
+
cmph_test = executable('cmph-bdz-test', '../cmph-bdz-test.c',
dependencies: [
cmph_dep,
diff --git a/girepository/meson.build b/girepository/meson.build
index 0261e1a5..1d7aed6b 100644
--- a/girepository/meson.build
+++ b/girepository/meson.build
@@ -1,9 +1,14 @@
subdir('cmph')
-custom_c_args = cc.get_supported_arguments([
- '-Wno-old-style-definition',
- '-Wno-cast-align',
-])
+custom_c_args = []
+
+if cc.get_id() != 'msvc'
+ custom_c_args = cc.get_supported_arguments([
+ '-Wno-old-style-definition',
+ '-Wno-cast-align',
+ ])
+endif
+
girepo_gthash_lib = static_library('girepository-gthash',
sources: 'gthash.c',
include_directories : configinc,
@@ -21,11 +26,14 @@ girepo_gthash_dep = declare_dependency(
include_directories: include_directories('.'),
)
-custom_c_args = cc.get_supported_arguments([
- '-Wno-unused-parameter',
- '-Wno-duplicated-branches',
- '-Wno-cast-align',
-])
+if cc.get_id() != 'msvc'
+ custom_c_args = cc.get_supported_arguments([
+ '-Wno-unused-parameter',
+ '-Wno-duplicated-branches',
+ '-Wno-cast-align',
+ ])
+endif
+
girepo_internals_lib = static_library('girepository-internals',
sources: [
'girmodule.c',
@@ -145,13 +153,16 @@ girepo_gir_sources = files(
install_headers(girepo_headers, subdir: 'gobject-introspection-1.0')
-custom_c_args = cc.get_supported_arguments([
- '-Wno-unused-parameter',
- '-Wno-duplicated-branches',
- '-Wno-type-limits',
- '-Wno-cast-align',
- '-Wno-missing-field-initializers',
-])
+if cc.get_id() != 'msvc'
+ custom_c_args = cc.get_supported_arguments([
+ '-Wno-unused-parameter',
+ '-Wno-duplicated-branches',
+ '-Wno-type-limits',
+ '-Wno-cast-align',
+ '-Wno-missing-field-initializers',
+ ])
+endif
+
girepo_lib = shared_library('girepository-1.0',
sources: girepo_sources,
include_directories : configinc,
diff --git a/giscanner/meson.build b/giscanner/meson.build
index 6ae34067..67c043d0 100644
--- a/giscanner/meson.build
+++ b/giscanner/meson.build
@@ -82,10 +82,14 @@ if not cc.has_header('unistd.h')
giscanner_args += '-DYY_NO_UNISTD_H'
endif
-custom_c_args = cc.get_supported_arguments([
- '-Wno-missing-field-initializers',
- '-Wno-unused-parameter',
-])
+custom_c_args = []
+if cc.get_id() != 'msvc'
+ custom_c_args = cc.get_supported_arguments([
+ '-Wno-missing-field-initializers',
+ '-Wno-unused-parameter',
+ ])
+endif
+
giscanner_lib = static_library('giscanner',
sources: [
'sourcescanner.c',
diff --git a/meson.build b/meson.build
index 07f9a8ae..4f863d31 100644
--- a/meson.build
+++ b/meson.build
@@ -63,6 +63,10 @@ if cc.get_id() != 'msvc'
project_c_args += [
'-fno-strict-aliasing',
]
+else
+ project_c_args += [
+ '-FImsvc_recommended_pragmas.h',
+ ]
endif
project_c_args = cc.get_supported_arguments(project_c_args)
diff --git a/tests/meson.build b/tests/meson.build
index 9c7c0765..369abac8 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -65,9 +65,13 @@ test_everything_files = custom_target('everything',
test_everything_headers = [test_everything_files[0]]
test_everything_sources = [test_everything_files[1]]
-custom_c_args = cc.get_supported_arguments([
- '-Wno-unused-parameter',
-])
+custom_c_args = []
+if cc.get_id() != 'msvc'
+ custom_c_args = cc.get_supported_arguments([
+ '-Wno-unused-parameter',
+ ])
+endif
+
everything_lib = shared_library('everything-1.0',
sources: test_everything_sources,
include_directories : configinc,
@@ -76,9 +80,12 @@ everything_lib = shared_library('everything-1.0',
version: '1.0.0',
)
-custom_c_args = cc.get_supported_arguments([
- '-Wno-unused-parameter',
-])
+if cc.get_id() != 'msvc'
+ custom_c_args = cc.get_supported_arguments([
+ '-Wno-unused-parameter',
+ ])
+endif
+
gimarshallingtests_lib = shared_library('gimarshallingtests-1.0',
sources: test_marshalling_sources,
include_directories : configinc,
diff --git a/tests/scanner/meson.build b/tests/scanner/meson.build
index ef459bbd..a028e3d2 100644
--- a/tests/scanner/meson.build
+++ b/tests/scanner/meson.build
@@ -23,9 +23,12 @@ endforeach
test_girs = []
test_typelibs = []
-custom_c_args = cc.get_supported_arguments([
- '-Wno-unused-parameter',
-])
+custom_c_args = []
+if cc.get_id() != 'msvc'
+ custom_c_args = cc.get_supported_arguments([
+ '-Wno-unused-parameter',
+ ])
+endif
typedef_lib = shared_library('typedef-1.0',
sources: ['typedefs.c'],
@@ -76,11 +79,13 @@ barapp_lib = shared_library('barapp-1.0',
dependencies: [gobject_dep, girepo_dep],
)
-custom_c_args = cc.get_supported_arguments([
- '-Wno-unused-parameter',
- '-Wno-old-style-definition',
- '-Wno-missing-field-initializers',
-])
+if cc.get_id() != 'msvc'
+ custom_c_args = cc.get_supported_arguments([
+ '-Wno-unused-parameter',
+ '-Wno-old-style-definition',
+ '-Wno-missing-field-initializers',
+ ])
+endif
if with_cairo
regress_deps = [cairo_dep, cairo_gobject_dep]
diff --git a/tools/meson.build b/tools/meson.build
index 48f981b7..f9b11616 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -43,9 +43,12 @@ if with_doctool
girdoctool = tool_output[-1]
endif
-custom_c_args = cc.get_supported_arguments([
- '-Wno-missing-field-initializers',
-])
+custom_c_args = []
+if cc.get_id() != 'msvc'
+ custom_c_args = cc.get_supported_arguments(['-Wno-missing-field-initializers'])
+endif
+
+
gircompiler = executable('g-ir-compiler', 'compiler.c',
dependencies: [
girepo_internals_dep,
@@ -55,9 +58,6 @@ gircompiler = executable('g-ir-compiler', 'compiler.c',
c_args: custom_c_args,
)
-custom_c_args = cc.get_supported_arguments([
- '-Wno-missing-field-initializers',
-])
girgenerate = executable('g-ir-generate', 'generate.c',
dependencies: [
girepo_internals_dep,
@@ -67,9 +67,6 @@ girgenerate = executable('g-ir-generate', 'generate.c',
c_args: custom_c_args,
)
-custom_c_args = cc.get_supported_arguments([
- '-Wno-missing-field-initializers',
-])
girinspect = executable('g-ir-inspect', 'g-ir-inspect.c',
dependencies: girepo_dep,
install: true,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]