You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working with a Meson project that consists of a top-level project listing several subprojects. Each of these subprojects defines an option named "part." However, some subprojects are not compatible with certain values of "part" and will not compile if the incompatible value is passed. My goal is to centrally manage the "part" option from the top-level project, effectively passing down a specific "part" value to each subproject, assuming this value is compatible with the subproject's requirements.
Here is a simplified structure of the project setup:
Top-Level Project: Lists subprojects A, B, and C.
Subproject A: Defines the option "part" and compiles with any value, yield is true.
Subproject B: Defines the option "part" but only compiles with "part-a", yield is false.
Subproject C: Defines the option "part" but only compiles with "part-b", yield is false.
The default_options argument in the subproject function seemed like the tool to achieve this, allowing the top-level project to specify default values for options in each subproject. However, I'm facing challenges in effectively passing down the "part" option from the top level to control each subproject's compilation behavior based on their compatible "part" values.
Given this setup, I expected to be able to set the "part" option from the top-level project and have that preference propagate down to each subproject, overriding their defaults if necessary, to ensure compatibility and successful compilation. Specifically, I thought that using default_options in the subproject declaration would allow me to achieve this level of control.
Question:
Is my understanding of how default_options should work in this context correct? Isn't the goal of the default_options argument in each subproject declaration to allow the top-level project to set and pass specific option values down to subprojects, overriding their local defaults if specified? If so, what might be preventing this from working as expected in my setup, and how can I ensure that each subproject uses the "part" option value that I specify from the top level?
I am looking for insights or guidance on achieving this configuration control, ensuring that each subproject compiles with the "part" option values that are compatible and specified from the top-level project.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm working with a Meson project that consists of a top-level project listing several subprojects. Each of these subprojects defines an option named "part." However, some subprojects are not compatible with certain values of "part" and will not compile if the incompatible value is passed. My goal is to centrally manage the "part" option from the top-level project, effectively passing down a specific "part" value to each subproject, assuming this value is compatible with the subproject's requirements.
Here is a simplified structure of the project setup:
The
default_options
argument in thesubproject
function seemed like the tool to achieve this, allowing the top-level project to specify default values for options in each subproject. However, I'm facing challenges in effectively passing down the "part" option from the top level to control each subproject's compilation behavior based on their compatible "part" values.Given this setup, I expected to be able to set the "part" option from the top-level project and have that preference propagate down to each subproject, overriding their defaults if necessary, to ensure compatibility and successful compilation. Specifically, I thought that using
default_options
in thesubproject
declaration would allow me to achieve this level of control.Question:
Is my understanding of how
default_options
should work in this context correct? Isn't the goal of thedefault_options
argument in eachsubproject
declaration to allow the top-level project to set and pass specific option values down to subprojects, overriding their local defaults if specified? If so, what might be preventing this from working as expected in my setup, and how can I ensure that each subproject uses the "part" option value that I specify from the top level?I am looking for insights or guidance on achieving this configuration control, ensuring that each subproject compiles with the "part" option values that are compatible and specified from the top-level project.
Beta Was this translation helpful? Give feedback.
All reactions