aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2022-04-28 16:08:24 -0400
committerXavier Claessens <xavier.claessens@collabora.com>2023-08-07 08:28:00 -0400
commit82a8c72187f844713618526ed3890d7b313b2065 (patch)
tree33c8df357aaf530901b8d56dc7832411dec3ab25 /test cases
parent7600856e0a1b1e058ef684928ac29a92218b1257 (diff)
downloadmeson-82a8c72187f844713618526ed3890d7b313b2065.zip
meson-82a8c72187f844713618526ed3890d7b313b2065.tar.gz
meson-82a8c72187f844713618526ed3890d7b313b2065.tar.bz2
c_std, cpp_std: Change to a list of desired versions in preference order
Projects that prefer GNU C but can fallback to ISO C can now set for example `default_options: 'c_std=gnu11,c11'` and it will use gnu11 when available, fallback to c11 otherwise. It is an error only if none of the values are supported by the current compiler. This allows to deprecate gnuXX values from MSVC compiler, that means that `default_options: 'c_std=gnu11'` will now print warning with MSVC but still fallback to 'c11' value. No warning is printed if at least one of the values is valid, i.e. `default_options: 'c_std=gnu11,c11'`. In the future that deprecation warning will become an hard error because `c_std=gnu11` should mean GNU is required, for projects that cannot be built with MSVC for example.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/unit/114 c cpp stds/meson.build6
1 files changed, 6 insertions, 0 deletions
diff --git a/test cases/unit/114 c cpp stds/meson.build b/test cases/unit/114 c cpp stds/meson.build
new file mode 100644
index 0000000..0b15efc
--- /dev/null
+++ b/test cases/unit/114 c cpp stds/meson.build
@@ -0,0 +1,6 @@
+project('c cpp stds', 'c', 'cpp',
+ default_options: [
+ 'c_std=gnu89,c89',
+ 'cpp_std=gnu++98,vc++11',
+ ],
+)