includes加载子xmake.lua如何继承子xmake的一些配置? #4156
Replies: 10 comments
-
Title: includes load sub-xmake.lua how to inherit some configurations of sub-xmake? In what scenario do you need this function?The parent xmake inherits some options from the child xmake, for example I hope that add_includedirs("test") will also take effect in the parent xmake describe possible solutionsadd_includedirs("test", public=true) this? Describe what you think is a candidateNo response other informationNo response |
Beta Was this translation helpful? Give feedback.
-
目前默认的继承关系是按 tree 结构,向下继承。。子 xmake.lua 能继承 父 xmake.lua 根域的配置 另外,要看你的说的是同一个 target 内继承,还是多个 target 之间。。 target 之间继承,跟是否父子 xmake.lua 无关,仅仅跟 add_deps 和 public = true 有关。。 target 内继承追加配置,可以不同 xmake.lua 重入 target 域,追加设置就行了 |
Beta Was this translation helpful? Give feedback.
-
The current default inheritance relationship is to inherit downwards according to the tree structure. . The child xmake.lua can inherit the configuration of the root domain of the parent xmake.lua In addition, it depends on whether you are talking about inheritance within the same target or between multiple targets. . Inheritance between targets has nothing to do with parent-child xmake.lua, but only with add_deps and public = true. . Inherit the additional configuration in the target, you can re-enter the target domain differently from xmake.lua, just add the settings |
Beta Was this translation helpful? Give feedback.
-
不是target 域,是描述域,比如子xmake.lua的描述域的有一个add_includedirs("test")我想让他一样在父xmake.lua的描述域生效 |
Beta Was this translation helpful? Give feedback.
-
我说的 target 域,就是 target 描述域 |
Beta Was this translation helpful? Give feedback.
-
It is not the target domain, but the description domain. For example, there is an add_includedirs("test") in the description domain of the child xmake.lua. I want it to take effect in the description domain of the parent xmake.lua |
Beta Was this translation helpful? Give feedback.
-
The target field I am talking about is the target description field |
Beta Was this translation helpful? Give feedback.
-
必须要add_deps么?没有用其他方法, 我现在是改第三方sdk,他是所有代码都会引用这个头,这个头不是固定位置跟随示例变动,我想在子xmake里确定它,描述域里会add_includedirs,这时候怎么让这个add_includedirs全局生效(父xmake描述域里也生效) |
Beta Was this translation helpful? Give feedback.
-
Is it necessary to add_deps? There is no other way. I am changing the third-party SDK now. All codes will refer to this header. This header is not fixed and changes with the example. I want to confirm it in the sub-xmake. Add_includedirs will be added in the description field. How to make it at this time This add_includedirs takes effect globally (it also takes effect in the parent xmake description domain) |
Beta Was this translation helpful? Give feedback.
-
描述域里面封装 function 去 wrap add_includedirs,在父描述域的根域调用下 父 includes("common")
add_common()
target("xxx")
-- .... 子 common/xmake.lua function add_common()
add_includedirs("xxx")
end |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
你在什么场景下需要该功能?
父xmake继承子xmake一些选项,例如
父xmake.lua:includes(A)
子xmake.lua:add_includedirs("test")
希望 add_includedirs("test")在父xmake里也生效
描述可能的解决方案
add_includedirs("test",public=true)这种?
描述你认为的候选方案
No response
其他信息
No response
Beta Was this translation helpful? Give feedback.
All reactions