请问如何自动切换依赖包的mode?
#3704
-
我尝试用下面这种方式: add_requires("xxx", {debug = true, alias = "XXXD"})
add_requires("xxx", {debug = false, alias = "XXXR"})
target("demo")
if get_config("debug") then
add_packages("XXXD")
else
add_packages("XXXR")
end 但是这种方式会导致找不到头文件 |
Beta Was this translation helpful? Give feedback.
Answered by
wanzzhehe
May 2, 2023
Replies: 1 comment
-
啊,直接在外面就行了,Orz, 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") |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
wanzzhehe
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
啊,直接在外面就行了,Orz,
get_config
原来是全局接口来着……更简单的写法: