Skip to content

Builtin options not forwarded correctly to subprojects #14497

@bonzini

Description

@bonzini

Describe the bug
The simplest reproducer is:

diff --git a/test cases/common/281 subproj options/subprojects/sub/meson.build b/test cases/common/281 subproj options/subprojects/sub/meson.build
index 9e3bceacf..b1fb9558a 100644
--- a/test cases/common/281 subproj options/subprojects/sub/meson.build	
+++ b/test cases/common/281 subproj options/subprojects/sub/meson.build	
@@ -1,2 +1,3 @@
-project('subproject')
+project('subproject', 'c')
 assert(get_option('bar') == true)
+assert(get_option('b_lto') == true)
diff --git a/test cases/common/281 subproj options/test.json b/test cases/common/281 subproj options/test.json
new file mode 100644
index 000000000..fcdf4ddd8
--- /dev/null
+++ b/test cases/common/281 subproj options/test.json	
@@ -0,0 +1,7 @@
+{
+  "matrix": {
+    "options": {
+      "b_lto":      [{ "val": "true" }]
+    }
+  }
+}

That is, a superproject is configured with -Db_lto=true but the subproject sees b_lto as false. This breaks QEMU's CFI builds (where the clang flags for CFI are added with add_global_arguments) but is a regression in general.

system parameters

  • Is this a cross build or just a plain native build (for the same computer)? no
  • what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.) Fedora 42
  • what Python version are you using e.g. 3.13.2
  • what meson --version 1.7.99 commit 02792fa
  • what ninja --version if it's a Ninja build N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions