summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2021-08-30 17:23:05 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2021-08-30 17:23:05 +0530
commitc99e3b312a613b38724a14d59ed98cce57d89e37 (patch)
tree71d3d61be01d2347a082e92352d799a070ccfddb
parent06869815fd55017b63b54b89c276ec75e87d864c (diff)
meson: Don't use add_global_arguments when a subproject
This is the correct fix for https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/236 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/259>
-rw-r--r--meson.build6
1 files changed, 4 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index 04ec9a9..303dba1 100644
--- a/meson.build
+++ b/meson.build
@@ -59,8 +59,10 @@ if not meson.is_subproject() and cc.get_id() == 'msvc'
endif
endif
-# Ensure that MSVC interprets all source code as UTF-8
-if cc.get_id() == 'msvc'
+# Ensure that MSVC interprets all source code as UTF-8. Only do this when we're
+# not a subproject, because subprojects are not allowed to call
+# add_global_arguments().
+if not meson.is_subproject() and cc.get_id() == 'msvc'
add_global_arguments(
cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
language: ['c', 'cpp'])