Specifying options for dependencies #6127
Unanswered
davidchisnall
asked this question in
Q&A
Replies: 1 comment 1 reply
-
option("foo", {description = "add foo dep", default = false})
target("foo")
set_default(false)
set_kind("static")
add_files("src/*.cpp")
target("test")
set_kind("binary")
add_files("src/*.cpp")
if has_config("foo") then
add_deps("foo")
end |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In a few cases, we’ve wanted to be able to specify that a target depends on another target and that the dependency must be built with a specific option. At the moment, we just end up documenting increasingly long
xmake config
strings that you must run.Is there something I can use in a target to change the default for an option? Can I set it in
on_load
or similar? It would be nice to be able to explicitly define option values as dependencies, I’m not sure if such a thing exists already.Beta Was this translation helpful? Give feedback.
All reactions