Skip to content

dependency.get_option('foo') doesn't work #11335

Answered by eli-schwartz
danielcjacobs asked this question in Q&A
Discussion options

You must be logged in to vote

Note, I believe I know what the problem is.

  • get_option doesn't work because bar_dep is a dependency and not a subproject (even though the subproject is used as the fallback to satisfy the dependency).

No.

obj.get_option() isn't a method of anywhere. It's a function get_option().

The reason it doesn't work would, presumably, be because you got an error message stating that dependency objects don't have any such method, right? ;)

  • Additionally, get_variable doesn't work, because the subproject must pass the variable to the root project via the variables parameter inside declare_dependency. If the subproject was used via subproject() instead of dependency(), then get_variable('foo') wou…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by danielcjacobs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #11334 on January 25, 2023 19:08.