从其他lua文件导入全局配置?
#2744
Replies: 1 comment
-
配置是按 tree 接口,从顶层往下继承的,根配置无法继承子 xmake.lua 里面的设置 方法1,这些配置放 root 顶层根描述域设置,所有子 xmake.lua 继承 function load_common_configs()
add_rules("mode.debug", "mode.release")
set_languages("c11", "cxx11")
set_symbols("debug")
if is_plat("windows") then
set_optimize("none")
set_runtimes("MDd")
else
set_optimize("none")
set_config("arch", "x86_64")
set_runtimes("MD")
end
end root xmake.lua load_common_configs() |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
我定义了一个平台相关的全局配置
platform.lua
希望用于其他项目复用:然后尝试在其他项目的
xmake.lua
中通过includes("../platform.lua")
但是从实验结果来看,这些设置没有预想中那样在目标工程的
xmake.lua
中生效并作用Describe the solution you'd like
请问我这个想法是否可行?或是有哪些步骤发生了错误?
Describe alternatives you've considered
No response
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions