aboutsummaryrefslogtreecommitdiffstats
path: root/meson/test cases/common/131 override options
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /meson/test cases/common/131 override options
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/common/131 override options')
-rw-r--r--meson/test cases/common/131 override options/four.c9
-rw-r--r--meson/test cases/common/131 override options/meson.build6
-rw-r--r--meson/test cases/common/131 override options/one.c3
-rw-r--r--meson/test cases/common/131 override options/three.c7
-rw-r--r--meson/test cases/common/131 override options/two.c6
5 files changed, 31 insertions, 0 deletions
diff --git a/meson/test cases/common/131 override options/four.c b/meson/test cases/common/131 override options/four.c
new file mode 100644
index 000000000..44e344f72
--- /dev/null
+++ b/meson/test cases/common/131 override options/four.c
@@ -0,0 +1,9 @@
+int func(void);
+
+static int duplicate_func(void) {
+ return -4;
+}
+
+int main(void) {
+ return duplicate_func() + func();
+}
diff --git a/meson/test cases/common/131 override options/meson.build b/meson/test cases/common/131 override options/meson.build
new file mode 100644
index 000000000..4dd8d797e
--- /dev/null
+++ b/meson/test cases/common/131 override options/meson.build
@@ -0,0 +1,6 @@
+project('option override', 'c',
+ default_options : 'unity=on')
+
+executable('mustunity', 'one.c', 'two.c')
+executable('notunity', 'three.c', 'four.c',
+ override_options : ['unity=off'])
diff --git a/meson/test cases/common/131 override options/one.c b/meson/test cases/common/131 override options/one.c
new file mode 100644
index 000000000..6120d4889
--- /dev/null
+++ b/meson/test cases/common/131 override options/one.c
@@ -0,0 +1,3 @@
+static int hidden_func(void) {
+ return 0;
+}
diff --git a/meson/test cases/common/131 override options/three.c b/meson/test cases/common/131 override options/three.c
new file mode 100644
index 000000000..094260e04
--- /dev/null
+++ b/meson/test cases/common/131 override options/three.c
@@ -0,0 +1,7 @@
+static int duplicate_func(void) {
+ return 4;
+}
+
+int func(void) {
+ return duplicate_func();
+}
diff --git a/meson/test cases/common/131 override options/two.c b/meson/test cases/common/131 override options/two.c
new file mode 100644
index 000000000..0f8048c21
--- /dev/null
+++ b/meson/test cases/common/131 override options/two.c
@@ -0,0 +1,6 @@
+/*
+ * Requires a Unity build. Otherwise hidden_func is not specified.
+ */
+int main(void) {
+ return hidden_func();
+}