Skip to content
Discussion options

You must be logged in to vote

啊,直接在外面就行了,Orz,get_config 原来是全局接口来着……

if get_config("mode") == "debug" then
    add_requires("xxx", {debug = true, alias = "X"})
else
    add_requires("xxx", {debug = false, alias = "X"})
end

target("demo")
    add_packages("X")

更简单的写法:

add_requires("xxx", {debug = get_config("mode") == "debug", alias = "X"})

target("demo")
    add_packages("X")

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by wanzzhehe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant